public class Main{ public static void main(String[]__){ System.out.println(2017-new java.util.Scanner(System.in).nextInt()); } }