using System; using System.IO; using System.Linq; using System.Collections; using System.Collections.Generic; using System.Text; using System.Numerics; using System.Threading.Tasks; using System.Text.RegularExpressions; using static System.Math; using Debug = System.Diagnostics.Debug; using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions; using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute; static class P { static void Main() { var a = Read(); var b = Read(); int res = 0; for (int i = a; i <= b; i++) { if ((a + b + i) % 3 == 0) res++; } Console.WriteLine(res); } static readonly TextReader In = Console.In; [MethodImpl(MethodImplOptions.AggressiveInlining)] static int Read() { int res = 0; int next = In.Read(); while (48 > next || next > 57) next = In.Read(); while (48 <= next && next <= 57) { res = res * 10 + next - 48; next = In.Read(); } return res; } }