#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int n;
int main() {
scanf("%d", &n);
string ans;
for (int i = 1;i <= 1000;++i) {
string s = to_string(i);
ans += s;
}
cout << ans[n - 1] - '0' << endl;
return 0;
}