#include #include using namespace std; using ll = long long; int main() { int Y; scanf("%d", &Y); printf("%d\n", 2017 - Y); }