#include <bits/stdc++.h>
using namespace std;
int getInt() {
  int x;
  scanf("%d", &x);
  return x;
}
long long getLongLong() {
  long long x;
  scanf("%I64d", &x);
  return x;
}
double getDouble() {
  double x;
  scanf("%lf", &x);
  return x;
}
char getChar() {
  char x;
  scanf("%c", &x);
  return x;
}
template <typename t>
t abs(t a) {
  if (a >= 0) return a;
  return -a;
}
struct dual {
  int a, b;
  bool const operator<(const dual &x) const {
    if (a == x.a) return b > x.b;
    return a < x.a;
  }
};
struct triple {
  int a, b, c;
  bool const operator<(const triple &x) const {
    if (c == x.c) {
      if (a == x.a) return b > x.b;
      return a < x.a;
    }
    return c < x.c;
  }
};
void FastIO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
}
string s;
int main() {
  for (int i = 1; i < 1000; i++) {
    int t = i;
    string x;
    while (t != 0) {
      x.push_back((t % 10) + '0');
      t /= 10;
    }
    reverse(x.begin(), x.end());
    s += x;
    x.clear();
  }
  int n = getInt();
  printf("%c\n", s[n - 1]);
  return 0;
}
