import java.util.Scanner; public class No530 { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.println(2017 - s.nextInt()); } }