#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
bool check_key(map<int64_t, int64_t> m, int64_t key) {
  if (m.find(key) == m.end()) return false;
  return true;
}
vector<int64_t> SieveOfEratosthenes(int64_t n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  vector<int64_t> res;
  for (int64_t p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int64_t i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (int64_t p = 2; p <= n; p++)
    if (prime[p]) res.push_back(p);
  return res;
}
int64_t decimalToOctal(int64_t decimalNumber) {
  int64_t rem, i = 1, octalNumber = 0;
  while (decimalNumber != 0) {
    rem = decimalNumber % 8;
    decimalNumber /= 8;
    octalNumber += rem * i;
    i *= 10;
  }
  return octalNumber;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  int64_t n;
  cin >> n;
  string s = "";
  for (int64_t i = 1; i <= 1000; i++) {
    s += to_string(i);
  }
  cout << s[n - 1] << ("\n");
  return 0;
}
