The input contains two integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 32), separated by a single space.
a = [1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 15, 16, 17, 18, 19, 22, 24, 27, 28, 29, 30, 31, 32, 33, 34, 40, 51, 53, 55, 56, 60, 66, 67, 69, 70, 71, 73, 76, 77, 79, 80, 86, 87, 89, 93, 95, 96, 97, 99, 100, 102, 103, 104, 106, 108, 110, 111, 114, 117, 118, 119, 120, 121, 123, 126, 128, 129, 130, 132, 133, 135, 136, 137, 139, 141, 142, 146, 147, 151, 152, 153, 154, 157, 159, 161, 162, 163, 165, 166, 172, 174, 176, 178, 180, 182, 183, 185, 190, 192, 198, 199, 200, 201, 202, 203, 204, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 226, 227, 228, 229, 230, 231, 240, 241, 242, 243, 244, 246, 247, 248, 249, 250, 253, 254, 255, 256, 265, 269, 271, 272, 273, 274, 277, 282, 284, 285, 286, 287, 289, 290, 291, 292, 293, 294, 297, 298, 299, 301, 302, 303, 306, 307, 308, 309, 310, 311, 312, 313, 316, 321, 325, 327, 328, 332, 333, 334, 337, 338, 339, 341, 346, 348, 352, 353, 354, 356, 360, 362, 365, 366, 367, 368, 373, 374, 378, 379, 380, 381, 382, 383, 385, 387, 388, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 415, 416, 417, 420, 423, 425, 426, 430, 431, 432, 437, 439, 440, 441, 443, 446, 447, 449, 452, 453, 455, 457, 460, 463, 465, 467, 469, 473, 475, 476, 479, 481, 482, 484, 486, 488, 494, 496, 498, 499, 505, 507, 509, 513, 514, 515, 516, 517, 519, 533, 535, 539, 540, 543, 544, 546, 550, 551, 552, 553, 555, 557, 558, 560, 562, 564, 567, 570, 571, 572, 573, 574, 576, 577, 578, 579, 583, 585, 587, 591, 592, 593, 595, 597, 598, 600, 601, 602, 603, 604, 605, 606, 610, 613, 618, 619, 620, 624, 632, 635, 636, 640, 643, 644, 650, 651, 653, 659, 663, 664, 666, 667, 669, 672, 673, 675, 676, 677, 680, 683, 686, 687, 689, 690, 695, 696, 697, 699, 701, 702, 704, 708, 712, 713, 714, 715, 717, 719, 721, 724, 725, 727, 728, 729, 731, 733, 736, 737, 740, 741, 742, 744, 747, 748, 750, 756, 757, 758, 760, 761, 765, 767, 770, 772, 774, 775, 776, 777, 781, 783, 784, 785, 786, 787, 788, 789, 795, 799, 800, 801, 803, 804, 805, 810, 812, 814, 815, 817, 818, 819, 820, 821, 834, 835, 836, 839, 841, 842, 844, 848, 850, 854, 856, 857, 859, 860, 861, 862, 863, 864, 865, 867, 871, 873, 874, 875, 876, 880, 881, 883, 885, 887, 888, 890, 892, 898, 901, 902, 903, 905, 907, 909, 910, 911, 912, 913, 916, 920, 921, 923, 924, 925, 927, 928, 929, 931, 933, 936, 938, 943, 945, 949, 950, 951, 952, 953, 954, 958, 960, 961, 962, 964, 968, 969, 971, 974, 977, 979, 980, 981, 982, 983, 984, 986, 987, 989, 991, 993, 994, 995, 997, 1000, 1004, 1005, 1007, 1008, 1009, 1010, 1012, 1013, 1015, 1017, 1018, 1019, 1024, 1030, 1033, 1034, 1037, 1038, 1041, 1042, 1043, 1044, 1045, 1048, 1049, 1050, 1051, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1065, 1066, 1068, 1072, 1074, 1077, 1078, 1080, 1081, 1082, 1085, 1089]
m,n = map(int, input().split())
if n in a:
    n = 1
else:
    n = 0
if m in a:
    m = 1
else:
    m = 0
print(n^m)