#include using namespace std; int main() { int y; cin >> y; printf("%d\n", 2017-y); return 0; }