#include "bits/stdc++.h" using namespace std; int main() { int D; cin >> D; if (D < 10) cout << D << endl; else { int X = (D - 10) / 2 + 10; if (D % 2 == 0) cout << X / 10 << endl; else cout << X % 10 << endl; } }