#include <bits/stdc++.h>
using namespace std;
inline void read() {}
template <typename F, typename S>
ostream &operator<<(ostream &os, const pair<F, S> &p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  typename vector<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
  os << "[";
  typename set<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}
template <typename F, typename S>
ostream &operator<<(ostream &os, const map<F, S> &v) {
  os << "[";
  typename map<F, S>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << it->first << " = " << it->second;
  }
  return os << "]";
}
string convString(int val) {
  string ret = "";
  while (val > 0) {
    ret += (val % 10 + '0');
    val /= 10;
  }
  reverse(ret.begin(), ret.end());
  return ret;
}
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  read();
  string str;
  int cur = 1;
  while (str.length() <= 1000) {
    str.append(convString(cur));
    cur++;
  }
  int n;
  cin >> n;
  cout << str[n - 1] << "\n";
}
