k = int(input()) n = int(input()) if k == n: print(3) elif k == 2 * n: print(6) elif k < n: print(4) elif k < 2 * n and k > n: print(5)