import sys #sys.setrecursionlimit(n) import heapq import re import bisect import random import math import itertools from collections import defaultdict, deque from copy import deepcopy from decimal import * a, b = map(int, input().split()) print(int(math.sqrt((a ** 2) + (b ** 2)) * 2 + 1))