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