#include #include #include #include #include #include #include #include #define FOR(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define FORR(i,l,n) for(int (i)=l;(i)<(int)(n);++(i)) int main() { int Y; scanf("%d", &Y); std::cout << 2017 - Y << std::endl; return 0; }