using System; using System.Collections.Generic; using System.Linq; namespace Test { class Program { static void Main(string[] args) { int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); if (x[0] == 0 && x[1] == 0) Console.WriteLine(1); else { double ret = Math.Sqrt(x[0] * x[0] + x[1] * x[1]); ret *= 2; Console.WriteLine(ret % 1 == 0 ? ret + 1 : ret); } } } }