using System; using static System.Console; using System.Linq; using System.Collections.Generic; using System.Globalization; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); static long[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; if (c[0] * 2 == c[1] || c[0] == c[1]) WriteLine(4); else if (c[0] * 2 > c[1] && c[0] < c[1]) WriteLine(8); else WriteLine(0); } }