#include #define int long long using namespace std; signed main() { int N; cin >> N; cout << 2017-N << endl; }