CodeEff/ECCO huggingface dataset:
# Original solution
N = int(eval(input()))
A = sorted(list(map(int, input().split())))

from collections import Counter
c = Counter(A)
w = 0
h = 0
for k, v in sorted(list(c.items()), key=lambda x: -x[0]):
    if v < 2:
        continue
    if v >= 4:
        if w == 0:
            w = h = k
            break
        else:
            h = k
            break
    elif v >= 2:
        if w == 0:
            w = k
        elif h == 0:
            h = k
            break
print((w*h))

# Optimized solution
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
 
from collections import Counter
c = Counter(A)
w = 0
h = 0
for k, v in sorted(list(c.items()), key=lambda x: -x[0]):
    if v >= 4:
        if w == 0:
            w = h = k
            break
        else:
            h = k
            break
    elif v >= 2:
        if w == 0:
            w = k
        elif h == 0:
            h = k
            break
print((w*h))
# Original solution
def 解():
    iN = int(eval(input()))
    iC = 0
    d = {}
    for a in reversed(sorted([int(_) for _ in input().split()])):
        if a in d:
            if d[a] == 3:
                print((a*a))
                exit()
            elif iC and iC != a:
                print((iC * a))
                exit()
            else:
                iC = a
                d[a] += 1
        else:
            d[a] = 1
    print((0))
解()


# Optimized solution
def 解():
    iN = int(eval(input()))
    iNow = 0
    iMem = 0
    iC = 0
    d = {}
    for a in reversed(sorted([int(_) for _ in input().split()])):
        if iNow == a:
            iC += 1
        else:
            iC = 1
            iNow = a
        if iC == 2:
            if iMem :
                print((iMem * iNow))
                exit()
            else:
                iMem = a
        elif iC == 4:
            print((iMem**2))
            exit()
    print((0))
解()
# Original solution
def 解():
    iN = int(eval(input()))
    iNow = 0
    iMem = 0
    iC = 0
    d = {}
    for a in reversed(sorted([int(_) for _ in input().split()])):
        if iNow == a:
            iC += 1
        else:
            iC = 1
            iNow = a
        if iC == 2:
            if iMem :
                print((iMem * iNow))
                exit()
            else:
                iMem = a
        elif iC == 4:
            print((iMem**2))
            exit()
    print((0))
解()


# Optimized solution
def 解():
    iN = int(eval(input()))
    m2_2 = 0 #複数あるものの二つ目
    m2 = 0 #複数あるもので最大
    m3 = 0 #3個あるもので最大
    m4 = 0 #4個あるもので最大
    d = set()
    for a in [int(_) for _ in input().split()]:
        if a in d:
            if  m2 < a :
                m2_2 = m2
                m2 = a
            elif m2 == a :
                if m3 < a :
                    m3 = a
                elif m3 == a:
                    if m4 < a:
                        m4 = a
            elif m2_2 < a:
                    m2_2 = a
        else:
            d.add(a)
    print((max(m2*m2_2,m4**2)))
解()
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))

c = {a: A.count(a) for a in A if A.count(a) >= 2}
cc = sorted(c)
x = len(c)
if(x <= 1):
  ans = 0
elif(c.get(cc[x-1]) >= 4):
  ans = cc[x-1] * cc[x-1]
else:
  ans = cc[x-1] * cc[x-2]
print(ans)

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
d = {}
for a in A:
  if(a in d):
    d[a] += 1
  else:
    d[a] = 1
x, y = 0, 0
for k, v in list(d.items()):
  if(v >= 2 and k > y):
    if(k >= x):
      if(v >= 4):
        y = k
      else:
        y = x
      x = k
    else:
      y = k
print((x * y))
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
a.sort(reverse=True)
d = {}
ans = []
for i in range(n):
    if a[i] in list(d.keys()):
        d[a[i]] += 1
    else:
        d[a[i]] = 1
    if d[a[i]]==4:
      ans.append(a[i])
    elif d[a[i]]==2:
      ans.append(a[i])
    if len(ans)> 1:
      break
ans.append(0)
ans.append(0)
print((ans[0]*ans[1]))

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
a.sort(reverse=True)
d = 0
ans = []
ap = 0
for i in range(n):
    if ap == a[i]:
        d += 1
        if d == 2:
            ans.append(a[i])
        elif d == 4:
            ans.append(a[i])
    else:
        d = 1
        ap = a[i]    
    if len(ans)> 1:
      break
ans.append(0)
ans.append(0)
print((ans[0]*ans[1]))
# Original solution
# -*- coding: utf-8 -*-

from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))

c = Counter(a)
li = sorted(list(c.items()), key=lambda x: x[0], reverse=True)

cands = []
for num, cnt in li:
    if cnt >= 4:
        cands += [num, num]
    elif cnt >= 2:
        cands += [num]

cands += [0, 0]
ans = cands[0] * cands[1]
print(ans)


# Optimized solution
# -*- coding: utf-8 -*-

from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))

pair = [0, 0]
c = Counter(a)
for num, cnt in list(c.items()):
    pair += [num] * (cnt // 2)

pair.sort(reverse=True)

ans = pair[0] * pair[1]
print(ans)
# Original solution
n = int(eval(input()))
a_list = list(map(int, input().split()))
nums = list(set(a_list))
nums.sort(reverse=True)
a = 0
b = 0
for num in nums:
	count = a_list.count(num)
	if count > 1:
		if a == 0:
			a = num
			if count > 3:				
				b = num
				break
		else:
			b = num
			break
r = a * b
print(r)

# Optimized solution
n = int(eval(input()))
a_list = list(map(int, input().split()))
counts = {}
for a in a_list:
	if a in counts:
		counts[a] += 1
	else:
		counts[a] = 1
counts = sorted(list(counts.items()), reverse=True, key=lambda x: x[0])
a = 0
b = 0
for key, value in counts:
	if value > 1:
		if a == 0:
			a = key
			if value > 3:
				b = key
				break
		else:
			b = key
			break
r = a*b
print(r)
# Original solution
n,*a=list(map(int,open(0).read().split()))
a.sort(reverse=True)
for i in range(1,n):
    if a[i]==a[i-1]:
        a[i]=0
    else:
        a[i-1]=0
a.sort()
print((a[-1]*a[-2]))

# Optimized solution
n,*a=list(map(int,open(0).read().split()))
a.sort()
x,y,i=0,0,0
while i<n:
  if a[i-1]==a[i]:
    x,y=y,a[i]
    i+=1
  i+=1
print((x*y))
# Original solution
from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
a = Counter(A)
sides = [0, 0]

for i in list(a.keys()):
    if a[i] >= 4:
        sides.append(i)
        sides.append(i)
    elif a[i] >= 2:
        sides.append(i)

sides.sort()
print((sides.pop() * sides.pop()))

# Optimized solution
from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
a = Counter(A)
sides = [0, 0]

for i in list(a.keys()):
    if a[i] >= 4:
        sides.append(i)
        sides.append(i)
    elif a[i] >= 2:
        sides.append(i)

sides.sort(reverse=True)
print((sides[0] * sides[1]))
# Original solution
def C_Make_a_Rectangle(lst):
    N = lst[0]
    A = lst[1:]

    from collections import Counter, deque
    c = sorted(list(Counter(A).items()), reverse=True)  # リストの要素が何回現れたか
    # cの0番要素は値、1番要素は度数

    ans = deque([])
    for k, v in c:
        if v == 1:
            continue
        elif v == 2 or v == 3:
            ans.append(k)
            if len(ans) == 2:
                break
        else:
            ans.append(k)
            ans.append(k)
            break

    if len(ans) < 2:
        return 0
    else:
        return ans[0] * ans[1]

n = int(eval(input()))
l = [int(i) for i in input().split()]
x = [n] + l
print((C_Make_a_Rectangle(x)))

# Optimized solution
def c_make_a_rectangle(N, A):
    from collections import Counter
    count = Counter(A)  # リストの要素が何回現れたか

    cond = []  # 同じ長さのものが2個ある棒の長さ
    for k, v in list(count.items()):
        if v == 1:  # 1個しかない棒では長方形を作れない
            continue
        else:
            cond.extend([k] * (v // 2))
    if len(cond) <= 1:
        return 0  # 長方形を作れない
    cond = sorted(cond, reverse=True)
    ans = cond[0] * cond[1]  # 長いもの2組を使う
    return ans

N = int(eval(input()))
A = [int(i) for i in input().split()]
print((c_make_a_rectangle(N, A)))
# Original solution
from collections import Counter as C

_ = eval(input())
a = C([int(x) for x in input().split()])

b = [0] * 2
for k, v in list(a.items()):
    if 4 <= v:
        b.append(k)
    if 2 <= v:
        b.append(k)
else:
    b.sort()
    print((b[-1] * b[-2]))

# Optimized solution
from collections import Counter as C

_ = eval(input())
a = C([int(x) for x in input().split()])

b = []
for k, v in list(a.items()):
    if 4 <= v:
        b.append(k)
    if 2 <= v:
        b.append(k)
else:
    if len(b) <= 1:
        print((0))
    else:
        b.sort()
        print((b[-1] * b[-2]))
# Original solution
n=int(eval(input()))
b=sorted([int(i) for i in input().split()],reverse=True)
def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2
A=groupby(b)
l=len(A)
B=[]
for i in range(l):
    A[i][1]=min(A[i][1]//2,2)
    if A[i][1]!=0:
        B.append(A[i])

l=len(B)
if l==0:
    print((0))
elif l==1:
    if B[0][1]==1:
        print((0))
    else:
        print((B[0][0]**2))
else:
    if B[0][1]==2:
        print((B[0][0]**2))
    else:
        print((B[0][0]*B[1][0]))


# Optimized solution
n=int(eval(input()))
a=sorted(list(map(int,input().split())),reverse=True)
x,y=0,0
def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2
b=groupby(a)
l=len(b)
for i in range(l):
    if x==0:
        if b[i][1]>=4:
            x,y=b[i][0],b[i][0]
        elif b[i][1]>=2:
            x=b[i][0]
    elif y==0:
        if b[i][1]>=2:
            y=b[i][0]
    else:
        break
print((x*y))
# Original solution
from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
d = Counter(a)
ans = -1

for k in sorted(d.keys())[::-1]:
    if ans == -1 and d[k] >= 4:
        print((k*k))
        exit()
    elif ans == -1 and d[k] >= 2:
        ans = k
    elif ans != -1 and d[k] >= 2:
        print((ans*k))
        exit()

print((0))

# Optimized solution
from collections import Counter

n = int(eval(input()))
d = Counter(list(map(int, input().split())))
ans = -1

for k in sorted(d.keys())[::-1]:
    if ans == -1 and d[k] >= 4:
        print((k*k))
        exit()
    elif ans == -1 and d[k] >= 2:
        ans = k
    elif ans != -1 and d[k] >= 2:
        print((ans*k))
        exit()

print((0))
# Original solution
a, b, c, d = input().split()
print((max(int(a) * int(b), int(c) * int(d))))

# Optimized solution
a, b, c, d = list(map(int, input().split())); print((max(a * b, c * d)))
# Original solution
a,b,c,d = list(map(int,input().split()))
print((int(max(a*b,c*d))))


# Optimized solution
a,b,c,d = list(map(int,input().split()))
print((max(a*b,c*d)))
# Original solution
a,b,c,d=list(map(int,input().split()))
if a*b >= c*d:
  print((a*b))
else:
  print((c*d))

# Optimized solution
a,b,c,d=list(map(int,input().split()))
print((max(a*b,c*d)))
# Original solution
A,B,C,D = list(map(int,input().split()))
print((max(A*B,C*D)))

# Optimized solution
# python3 (3.4.3)
import sys
input = sys.stdin.readline

# main
A,B,C,D = list(map(int,input().split()))

print((max(A*B,C*D)))
# Original solution
A, B, C, D = list(map(int, input().split()))
area1 = A * B
area2 = C * D
print((area1 if area1 >= area2 else area2))

# Optimized solution
A, B, C, D = list(map(int, input().split()))
areas = [A * B, C * D]
print((max(areas)))
# Original solution
a,b,c,d = list(map(int,input().split()))

ans = a*b, c*d

print((max(ans)))

# Optimized solution
A,B,C,D = list(map(int,input().split()))

if A * B > C * D:
    print((A * B))
elif A * B < C * D:
    print((C * D))
else:
    print((A * B))
# Original solution
a = list(map(int,input().split()))
x = a[0] * a[1]
y = a[2] * a[3]
if x >= y:
  print(x)
else:
  print(y)

# Optimized solution
a = list(map(int,input().split()))
b = a[0] * a[1]
c = a[2] * a[3]

if b > c:
  print(b)
else:
  print(c)
# Original solution
A, B, C, D = list(map(int, input().split()))
if A*B>C*D:
	print((A*B))
else:
	print((C*D))

# Optimized solution
A, B, C, D = list(map(int, input().split()))
print((max(A*B, C*D)))
# Original solution
A, B, C, D = list(map(int,input().split()))

if A * B == C * D:
    print((A * B))
else:
    print((max(A * B, C * D)))

# Optimized solution
a, b, c, d = list(map(int,input().split()))
print((max(a * b, c * d)))
# Original solution
a, b, c, d = list(map(int, input().split()))
s1 = a * b
s2 = c * d
if s1 > s2:
  print(s1)
else:
  print(s2)

# Optimized solution
a, b, c, d = list(map(int, input().split()))
print((max(a*b, c*d)))
# Original solution
vertical1, horizontal1, vertical2, horizontal2 = list(map(int, input().split()))
area1 = vertical1 * horizontal1
area2 = vertical2 * horizontal2
if area1 < area2:
    print(area2)
else:
    print(area1)

# Optimized solution
A, B, C, D = list(map(int, input().split()))
print((max(A * B, C * D)))
# Original solution
A,B,C,D=list(map(int,input().split()))

if A*B>=C*D:
  print((A*B))
else:
  print((C*D))

# Optimized solution
A,B,C,D = list(map(int,input().split()))
print((max(A*B,C*D)))
# Original solution
A,B,C,D = list(map(int,input().split()))
X = A*B
Y = C*D
if X >= Y:
    print(X)
else:
    print(Y)
    


# Optimized solution
A, B, C, D = list(map(int, input().split()))
print((max(A * B, C * D)))
# Original solution
# -*- coding: utf-8 -*-

a, b, c, d = list(map(int, input().split()))

sq = [a * b, c * d]

if sq[0] > sq[1]:
    ans = sq[0]
else:
    ans = sq[1]

print(ans)

# Optimized solution
# -*- coding: utf-8 -*-

a, b, c, d = list(map(int, input().split()))

ans = max(a * b, c * d)

print(ans)
# Original solution
a,b,c,d = list(map(int,input().split()))
if a*b > c*d:
    print((a*b))
else:
    print((c*d))


# Optimized solution
a,b,c,d = list(map(int,input().split()))
if a*b >= c*d:
    print((a*b))
else:
    print((c*d))
# Original solution
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, C, D = list(map(int, readline().split()))

    if A * B > C * D:
        print((A * B))
    else:
        print((C * D))

    return


if __name__ == '__main__':
    main()


# Optimized solution
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, C, D = list(map(int, readline().split()))

    print((max(A * B, C * D)))

    return


if __name__ == '__main__':
    main()
# Original solution
a, b, c, d = list(map(int, input().split()))
print((max(a * b, c * d) if a * b != c * d else a * b))

# Optimized solution
a, b, c, d = list(map(int, input().split()))

print((max(a * b, c * d)))
# Original solution
import sys
from itertools import dropwhile
a = []
for v in sys.stdin:
    a.append(int(v))

m = max([a.count(v) for v in set(a)])
try:
    next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == m)))
except StopIteration:
    pass


# Optimized solution
a = [0] * 101
while True:
    try:
        a[int(eval(input()))] += 1
    except:
        break
maxv = max(a)
for i, v in enumerate(a):
    if maxv == v:
        print(i)
# Original solution
# 0028
array = []
while True:
    try:
        a = eval(input())
        array.append(int(a))
    except EOFError:
        break
s = set(array)
mx = array.count(max(s, key = array.count))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

# Optimized solution
# 0028
array = []
while True:
    try:
        a = eval(input())
        array.append(int(a))
    except EOFError: break
s = set(array)
mx = max(sorted(s, reverse=True), key = array.count)
for a in sorted(s, key = array.count, reverse=True):
    print(a)
    if a == mx: break
# Original solution
d=[0 for i in range(101)]

while True:
    try:
        n=eval(input())
        d[n]+=1
    except:
        break

for e in [i for i,e in enumerate(d) if e==max(d)]:
    print(e)

# Optimized solution
d=[0]*101

while True:
    try:
        n=eval(input())
        d[n]+=1
    except:
        break

tmp=max(d)
for i in range(101):
    if d[i]==tmp: print(i)
# Original solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(eval(input()))
i = 1
num = [0] * 13

while True:
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1
    if cnt >= 12:
        i += 1
        continue

    if num[cnt] == 0:
        num[cnt] = i

    if num[n] > 0:
        ans = num[n]
        break

    i += 1

print(ans)

# Optimized solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(eval(input()))
i = 1
num = [0] * 13

while True:
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1

    if cnt > 12:
        i += 1
        continue

    if num[cnt] == 0:
        num[cnt] = i

    if num[n] > 0:
        ans = num[n]
        break

    i += 1

print(ans)
# Original solution
from collections import Counter
n = int(input())
s = Counter([input() for i in range(n)])
print(*['{} x {}'.format(k, s[k]) for k in ['AC', 'WA', 'TLE', 'RE']], sep='\n')


# Optimized solution
n = int(input())
s = [input() for i in range(n)]
print(*['{} x {}'.format(k, s.count(k)) for k in ['AC', 'WA', 'TLE', 'RE']], sep='\n')
# Original solution
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()
ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
    t = S()
    if t == 'AC':
        ac += 1
    elif t == 'WA':
        wa += 1
    elif t == 'TLE':
        tle += 1
    elif t == 'RE':
        re += 1
print(('AC x '+str(ac)))
print(('WA x '+str(wa)))
print(('TLE x '+str(tle)))
print(('RE x '+str(re)))

# Optimized solution
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(N):
    t = S()
    if t == 'AC':
        ac += 1
    elif t == 'WA':
        wa += 1
    elif t == 'TLE':
        tle += 1
    elif t == 'RE':
        re += 1
print(('AC x {}'.format(ac)))
print(('WA x {}'.format(wa)))
print(('TLE x {}'.format(tle)))
print(('RE x {}'.format(re)))
# Original solution
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
cnt = [0]*4
for i in range(N):
    S = readline().decode().rstrip()
    if S == 'AC':
        cnt[0] +=1
    if S == 'WA':
        cnt[1] +=1
    if S == 'TLE':
        cnt[2] +=1
    if S == 'RE':
        cnt[3] +=1
print(('AC x '+str(cnt[0])))
print(('WA x '+str(cnt[1])))
print(('TLE x '+str(cnt[2])))
print(('RE x '+str(cnt[3])))

# Optimized solution
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
S = read().decode().rstrip().split()
for s in ['AC','WA','TLE','RE']:
    print(("{0} x {1}".format(s,S.count(s))))
# Original solution
N,M = list(map(int,input().split()))
if N ==1 and M ==1:
    print((0))
elif N ==1 and M != 1:
    print((int(M*(M-1)/2)))
elif N != 1 and M ==1:
    print((int(N*(N-1)/2)))
else:    
    a = N*(N-1)
    b = M*(M-1)
    print((int((a+b)/2)))

# Optimized solution
N,M = list(map(int,input().split())) 
a = N*(N-1)
b = M*(M-1)
print((int((a+b)/2)))
# Original solution
a,b = input().split()
a = int(a)
b = int(b)
A = a-1
B = b-1

S = a*A/2
F = b*B/2
if a<1.9 and b<1.9:
  print((0))
elif a<1.9 and b>1.9:
  print((int(F)))
elif a>1.9 and b<1.9:
  print((int(S)))
elif a>1.9 and b>1.9:
  print((int(S+F)))
        


# Optimized solution
a,b = input().split()
a = int(a)
b = int(b)


S = a*(a-1)/2
F = b*(b-1)/2
if a<1.9 and b<1.9:
  print((0))
elif a<1.9 and b>1.9:
  print((int(F)))
elif a>1.9 and b<1.9:
  print((int(S)))
elif a>1.9 and b>1.9:
  print((int(S+F)))
# Original solution
import itertools
n, m = list(map(int, input().split()))

nn = []
i = 0
for _ in range(n):
    nn.append(i)
    i += 2

mm = []
i = 1
for _ in range(m):
    mm.append(i)
    i += 2

ans = 0
l = nn + mm

for v in itertools.combinations(l, 2):
    if (v[0] + v[1]) % 2 == 0:
        ans += 1
print(ans)


# Optimized solution
n, m = list(map(int, input().split()))
print((n*(n-1)//2 + m*(m-1)//2))
# Original solution
# -*- coding: utf-8 -*-

m, n = list(map(int, input().split(' ')))

print((int(m * (m - 1) / 2 + n * (n - 1) / 2)))


# Optimized solution
# -*- coding: utf-8 -*-
n, m = list(map(int, input().split()))

print((n * (n -1) // 2 + m * (m - 1) // 2))
# Original solution
a,b=list(map(int,input().split()))
import itertools
a1 = len(list(itertools.combinations(list(range(a)), 2)))
b1 = len(list(itertools.combinations(list(range(b)), 2)))
print((a1+b1))

# Optimized solution
a,b=list(map(int,input().split()))
print((a*(a-1)//2+b*(b-1)//2))
# Original solution
n,m = list(map(int, input().split()))

s = 0
for i in range(n):
  s += i
for i in range(m):
  s += i
print(s)

# Optimized solution
n,m = list(map(int, input().split()))

print((n*(n-1)//2 + m*(m-1)//2))
# Original solution
n, m = list(map(int, input().split()))

a = []
for i in range(1,n+1):
  a.append(2*i)
for j in range(1, m+1):
  a.append(2*j - 1)

counter = 0
for i in range(len(a)-1):
  for j in range(i+1, len(a)):
    if (a[i] + a[j]) % 2 == 0:
      counter += 1
      
print(counter)

# Optimized solution
n, m = list(map(int, input().split()))

ans = n * (n-1) // 2 + m * (m-1) // 2
print(ans)
# Original solution
N, M = list(map(int, input().split()))

if N <= 1: a = 0
else: a = N*(N-1) // 2

if M <= 1: b = 0
else: b = M*(M-1) // 2
  
print((a+b))

# Optimized solution
N, M = list(map(int, input().split()))

# 下の式はN=0,1(M=0,1)の場合も成り立つ
a = N*(N-1) // 2
b = M*(M-1) // 2
  
print((a+b))
# Original solution
import itertools
import math

N,M=list(map(int,input().split()))
if N==M==1 or N==M==0:
  print((0))
  exit()
if N==0:
  even=0
  odd=math.factorial(M)/(math.factorial(M-2)*2)
  print((int(odd+even)))
  exit()
if M==0:
  odd=0
  even=math.factorial(N)/(math.factorial(N-2)*2)
  print((int(odd+even)))
  exit()
if N==1 or M==1:
  even=math.factorial(N)/2
  odd=math.factorial(M)/2
  print((int(odd+even)))
  exit()

even=math.factorial(N)/(math.factorial(N-2)*2)
odd=math.factorial(M)/(math.factorial(M-2)*2)
print((int(odd+even)))

# Optimized solution
import itertools
import math

N,M=list(map(int,input().split()))
ans = 0
even = 0
odd = 0
if N > 1:
    even += math.factorial(N) / (math.factorial(2)*math.factorial(N - 2))
if M > 1:
    odd += math.factorial(M) / (math.factorial(2)*math.factorial(M - 2))
ans=even+odd
print((int(ans)))
# Original solution
n,m = list(map(int,input().split()))
print(((n*(n-1)//2) + (m*(m-1)//2)))

# Optimized solution
#!/usr/bin/env python3
n,m = list(map(int,input().split()))
print(((n*(n-1)//2) + (m*(m-1)//2)))
# Original solution
import math
n, m = list(map(int, input().split()))

def combinations_count(a, b):
    return math.factorial(a+b) // (2 * math.factorial(a+b-2))

print((combinations_count(n, m)-(n*m)))

# Optimized solution
n, m = list(map(int, input().split()))
print(((n*(n-1)//2)+(m*(m-1)//2)))
# Original solution
N, M = list(map(int, input().split()))

print((M * (M - 1) // 2 + N * (N - 1) // 2))


# Optimized solution
N, M = list(map(int, input().split()))

print((N * (N - 1) // 2 + M * (M - 1) // 2))
# Original solution
N,M=list(map(int,input().split()))
print((int(1/2*N*(N-1)+1/2*M*(M-1))))

# Optimized solution
N,M=list(map(int,input().split()))
print((N*(N-1)//2+M*(M-1)//2))
# Original solution
N,M=list(map(int,input().split()))
if N >= 2 or M >= 2:
  print((int(N*(N-1)/2+M*(M-1)/2)))
else:
  print((0))

# Optimized solution
N,M=list(map(int,input().split()))
print((int(N*(N-1)/2+M*(M-1)/2)))