#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int sum = 0, sch = 1;
  for (int i = 1; sum <= n; i++) {
    if (i == 10) sch++;
    if (i == 100) sch++;
    if (sum == n) {
      cout << (i - 1) % 10;
      break;
    }
    if (sum + sch > n) {
      int x = i;
      string s;
      while (x) s += x % 10 + '0', x /= 10;
      cout << s[s.size() - (n - sum)];
      break;
    }
    sum += sch;
  }
  return 0;
}
