#include using namespace std; int main() { short Y,a; cin >> Y; a = 2017 - Y; cout << Y << endl; return 0; }