#include<iostream>
#include<cstring>
using namespace std;
unsigned int Fun(unsigned char* buffer, int size)
{
unsigned int x = 1;
unsigned int p = x + (x << 1) + (x << 2) + (x << 4) + (x << 5) + (x << 7) + (x << 8) + (x << 10) + (x << 11) + (x << 12) + (x << 16) + (x << 22) + (x << 23) + (x << 26);
unsigned int crc = 0;
unsigned int now = 0;
for (int i = 0; i < size; i++)
{
for (int j = 7; j >= 0; j--)
{
unsigned int q = 0;
if ((now >> 31) & (unsigned int)1) q = p;
now = (now << 1) | ((buffer[i] >> j) & (unsigned int)1);
now = (now ^ q);
crc = now;
}
}
return crc;
}
int main() {
unsigned char* a = new unsigned char[10];
cin >> a;
cout << Fun(a, strlen((const char*)a));
return 0;
}