import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = Integer.parseInt(sc.next()); int b = Integer.parseInt(sc.next()); int[] day = new int[31]; for(int i = a - 1; i < b; i++) { day[i] = 1; } int ans = 3 - (day[22] + day[23] + day[24]); System.out.println(ans); } }