#!python # -*- coding: utf-8 -*- A, B = map(int, input().split()) c = 0 for i in range(A, B + 1): if sum((A, B, i)) % 3 == 0: c += 1 print(c)