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