# -*- coding:utf-8 -*- import math if __name__ == '__main__': xp, yp = map(int, input().split()) h = math.hypot(xp, yp) * 2 if h - int(h) == 0: h += 1 print(math.ceil(h))