Can someone explain how San Marino televote is counted?

I just saw that Lithuania got 12 points from San Marino in semi final, which is so completely random, and I am yet again so very confused how it works