#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T b, T p, T M) {
  long long ret = 1;
  for (; p > 0; p >>= 1) {
    if (p & 1) ret = (ret * b) % M;
    b = (b * b) % M;
  }
  return (T)ret;
}
const double PI = acos(-1.0), EPS = 1e-7;
const long long INF = (long long)1e18 + 7;
const int N = 1e3 + 5, M = 1e9 + 7;
int main() {
  string s = "", t;
  for (int i = 1; i < N; i++) {
    stringstream ss;
    ss << i;
    ss >> t;
    s += t;
    if (s.size() > N) break;
  }
  int n;
  cin >> n;
  cout << s[n - 1] << endl;
  return 0;
}
