#include<iostream> using namespace std; int main(){ int M=0; cin>>M; if(M%2==0){ cout<<0; }else{ cout<<1; } return 0; }