import java.util.Scanner; public class Main { public static void main(String[] args) { Main main=new Main(); main.run(); } void run() { Scanner sc=new Scanner(System.in); int A=sc.nextInt(); int B=sc.nextInt(); int counter=0; for(int i=A;i<=B;i++) { if((A+B+i)%3==0) { counter++; } } System.out.println(counter); } }