#include #include int main(){ int n; scanf("%d",&n); printf("%d\n",2017-n); return 0; }