#include using namespace std; int n, ans; int main() { cin >> n; if(n < 10) cout << n << endl; else { n -= 9; if(n % 2) ans = (9 + (n + 1) / 2) / 10; else ans = (9 + (n + 1) / 2) % 10; } cout << ans << endl; return 0; }