import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No00000632_Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { String[] a = br.readLine().split(" "); String r = "14"; if("2".equals(a[1])) { r = "4"; } else if("3".equals(a[1])) { r = "1"; } System.out.println(r); } }