import math import numpy as np from collections import deque from collections import Counter import sys input = sys.stdin.readline # sys.setrecursionlimit(25000) x, y = list(map(int, input().split(' '))) d = math.sqrt(x ** 2 + y ** 2) * 2 print(math.floor(d) + 1)