
/**//*
*此小程序是连续输入身份证前面的十七位得到最后一位
*/
#include<iostream>
#include<string>
using namespace std;

int main()


{
string id_17;
cin>>id_17;
int i=0;

int a[17]=
{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
int b[17];

char c[17]=
{'1','0','X','9','8','7','6','5','4','3','2'};
while(id_17[i]!='\0')

{
b[i]=id_17[i]-48;
i++;
}
int result=0;
for (int j=0;j<17;j++)

{
result+=a[j]*b[j];
}
cout<<c[result%11]<<endl;
return 0;
}