#include using namespace std; int main() { int y; cin >> y; int ans = 2017 - y; cout << ans << endl; return 0; }