#include <bits/stdc++.h>
using namespace std;
long long powerMod(long long number, long long power) {
  long long int ret = 0;
  if (power == 0) return 1;
  if (power == 1) return number;
  if (power % 2 == 0) {
    ret = powerMod(number, power / 2);
    ret = (ret * ret);
    return ret;
  } else {
    ret = powerMod(number, power / 2);
    ret = (ret * ret * number);
    return ret;
  }
}
int main() {
  int n, i;
  scanf("%d", &n);
  string s;
  for (i = 1; i <= 1000; i++) {
    string add = to_string(i);
    s += add;
  }
  cout << s[n - 1];
  return 0;
}
