#include using namespace std; unsigned champernowne(const unsigned &n) { if (n < 10) return n; if (n % 2 == 0) return (n + 10) / 20; return (n + 9) / 2 % 10; } void solve() { int N; cin >> N; cout << champernowne(N) << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); solve(); getchar(); }