#include "bits/stdc++.h" using namespace std; using ll = long long; using IP = pair; #define INF 999999999 #define atcoder(int)1e9+7 #define Endl endl int main() { int Y; cin >> Y; cout << 2017 - Y << endl; return 0; }