#include <iostream>
#include <string>
using namespace std;
int main() {
	string a;
	cin >> a;
int aback= a.back()-'0';
cout << aback ;
	return 0;
}