#include using namespace std; int main(){ int D; cin >> D; if(D <= 9){ cout << D; }else if(D%2 == 0){ cout << (D+10)/20; }else{ cout << (D+9)/2%10; } }