#include<iostream>

int main()
{
	double num;
	std::cin >> num;
	std::cout << int(num) % 10;

	return 0;
}