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