#!/usr/bin/python # -*- coding: utf-8 -*- import math x,y = map(int, raw_input().split()) tmp = math.sqrt(x**2*1.0 + y**2*1.0) * 2 if tmp % 1 == 0: print int(tmp + 1) else: print int(math.ceil(tmp))