package m.shin; import java.util.Scanner; public class Con530 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int y = s.nextInt(); s.close(); System.out.println(2017-y); } }