#include using namespace std; int m; int main() { cin >> m; cout << m % 2 << endl; return 0; }