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