import std; int calc(int d1, int d2) { if (d1 == d2) return 4; if (d1 > d2) return 0; double r = sqrt(1.0 * d1); double s = sqrt(d2 / 2.0); if (r < s) return 0; if (r > s) return 8; return 4; } void main() { int d1, d2; scan(d1, d2); writeln(calc(d1, d2)); } void scan(T...)(ref T a) { string[] ss = readln.split; foreach (i, t; T) a[i] = ss[i].to!t; } T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int;