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