#include #include #include #include #include #include #include #include #include #include #include #define REP(i, N) for(ll i = 0; i < N; ++i) #define FOR(i, a, b) for(ll i = a; i < b; ++i) #define ALL(a) (a).begin(),(a).end() #define pb push_back #define INF (long long)1000000000 #define MOD 1000000007 #define EPS (long double) 1e-8 using namespace std; typedef long long ll; typedef long double ld; typedef pair P; int dh[4] = {1, 0, -1, 0}; int dw[4] = {0, 1, 0, -1}; using namespace std; int main() { int y; cin>>y; cout<<2017 - y<