Problem:
 Score : 100 points    Problem Statement  We have N+M balls, each of which has an integer written on it. It is known that:   The numbers written on N of the balls are even.  The numbers written on M of the balls are odd.   Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. It can be shown that this count does not depend on the actual values written on the balls.      Constraints   0 \leq N,M \leq 100  2 \leq N+M  All values in input are integers.         Input  Input is given from Standard Input in the following format:  N  M       Output  Print the answer.        Sample Input 1 2 1      Sample Output 1 1  For example, let us assume that the numbers written on the three balls are 1,2,4 .   If we choose the two balls with 1 and 2 , the sum is odd;  If we choose the two balls with 1 and 4 , the sum is odd;  If we choose the two balls with 2 and 4 , the sum is even.   Thus, the answer is 1 .       Sample Input 2 4 3      Sample Output 2 9       Sample Input 3 1 1      Sample Output 3 0       Sample Input 4 13 3      Sample Output 4 81       Sample Input 5 0 3      Sample Output 5 3

Solution (Python):
n,m=map(int,input().split())

ans = n*(n-1)//2 + m*(m-1)//2
print(ans)

Solution (Python):
N, M = map(int, input().split())
print(N*(N-1)//2+M*(M-1)//2)

Solution (Python):
n, m = map(int, input().split())

ans = n*(n-1)//2 + m*(m-1)//2
print(ans)

Solution (Python):
A,B=map(int, input().split())

print(A*(A-1)//2+B*(B-1)//2)

Solution (Python):
n,m=map(int,input().split())
ans=n*(n-1)//2+m*(m-1)//2
print(ans)

Solution (Python):


a,b = map(int,input().split())



print(a*(a-1)//2 + b*(b-1)//2)

Solution (Python):
from sys import stdin
def main():
    readline=stdin.readline
    N,M=map(int,readline().split())
    a=N*(N-1)//2
    b=M*(M-1)//2
    print(a+b)
if __name__=="__main__":
    main()

Solution (Python):
n,m = map(int,input().split())
ans = 0
if n>1:
  ans += n*(n-1)//2
if m>1:
  ans += m*(m-1)//2
print(ans)

Solution (Python):
N, M = map(int, input().split())
print(N * (N - 1) //2 + M * (M - 1) // 2)

Solution (Python):
def main():
    N, M = map(int, input().split())
    ret = N * (N - 1) + M * (M - 1)
    print(ret // 2)


if __name__ == '__main__':
    main()

Solution (Python):
n, m = map(int, input().split())

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

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
n,m = map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
n,m = map(int,input().split())
print(n*(n-1)//2 + m*(m-1)//2)

Solution (Python):
n,m = map(int,input().split())

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

Solution (Python):
N,M = map(int,input().split())
ans = N*(N-1)/2 + M*(M-1)/2
print(int(ans))

Solution (Python):
n, m = map(int, input().split())

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

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
n, m = map(int, input().split())
print(n * (n-1) // 2 + m * (m-1) // 2)

Solution (Python):
N, M = map(int, input().split())
print((N * (N - 1)) // 2 + ((M * (M - 1)) // 2))

Solution (Python):
N,M=map(int,input().split())
print(N*(N-1)//2+M*(M-1)//2)

Solution (Python):
N, M = list(map(int, input().split()))
a = (N * (N - 1)) // 2
b = (M * (M - 1)) // 2

print (a + b)

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
n,m = map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):

import sys


def solve(N: int, M: int):
    print(N*(N-1)//2 + M*(M-1)//2)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    solve(N, M)

if __name__ == '__main__':
    main()

Solution (Python):
N, M = map(int, input().split())

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

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):

import itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)

def main():
    N,M = map(int,input().split())
    print((N*(N-1)+M*(M-1))//2)

if __name__ == "__main__":
  main()

Solution (Python):
N,M = map(int,input().split())
ans = N*(N-1)//2 + M*(M-1)//2
print(ans)

Solution (Python):
N, M = map(int, input().split())
ans = N*(N-1)//2 + M*(M-1)//2
print(ans)

Solution (Python):
n, m = map(int, input().split())

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

Solution (Python):
N, M = map(int, raw_input().split())
ans = 0

ans = ans + N*(N-1)/2
ans = ans + M*(M-1)/2

print ans

Solution (Python):
N, M = map(int, input().split())
print(N*(N-1)//2+M*(M-1)//2)

Solution (Python):
n, m = map(int, input().split())
print(int(n*(n-1)/2+m*(m-1)/2))

Solution (Python):

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

ans = n * (n - 1) // 2 + m * (m - 1) // 2
print(ans)

Solution (Python):
n,m = map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
print(N * (N - 1) // 2 + M * (M - 1) // 2)

Solution (Python):
n,m = map(int, input().split())
ans = (n*(n-1))//2 + (m*(m-1))//2
print(ans)

Solution (Python):
n,m = map(int,input().split())
print((n*(n-1)//2) + (m*(m-1)//2))

Solution (Python):
n,m = map(int,input().split())
print((n*(n-1)+m*(m-1))//2)

Solution (Python):
n,m = map(int,input().split())
ans = (n+m)*(n+m-1)//2-n*m
print(ans)

Solution (Python):

from math import factorial
def com(n,r):
    if n<r:
        return 0
    return int(factorial(n) // factorial(r) // factorial(n-r))
N, M = map(int, input().split())
print(com(N, 2) + com(M, 2))

Solution (Python):
import sys
input=lambda: sys.stdin.readline().rstrip()
n,m=map(int,input().split())
ans=(n+m)*(n+m-1)//2-n*m
print(ans)

Solution (Python):
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left 

sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input():
    return sys.stdin.readline()[:-1]
def pri(x):
    if type(x) is list:
        print('\n'.join(map(str, x)))
    else:
        print(x)

N, M = map(int, input().split())

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

Solution (Python):
N, M = map(int,input().split())

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

Solution (Python):
def examA():
    N, M = LI()
    ans = N*(N-1)//2 + M*(M-1)//2
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examA()

"""

"""

Solution (Python):
N,M=map(int,input().split())
print(N*(N-1)//2+M*(M-1)//2)

Solution (Python):
InputIntList = lambda : list(map(int, input().split()))
InputStrList = lambda : list(input().split())

N, M = InputIntList()

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

Solution (Python):
N, M = map(int, input().split())
print(N*(N-1)//2 + M*(M-1)//2)

Solution (Python):

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

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

Solution (Python):
n, m = map(int, input().split())
a = n*(n-1)//2
b = m*(m-1)//2
print(a+b)

Solution (Python):
N, M = [int(s) for s in input().split()]

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

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n, m = na()
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
def main():

    N, M = map(int, input().split())
    return N * (N-1) //2 + M * (M-1) // 2

if __name__ == '__main__':
    print(main())

Solution (Python):
N, M = map(int, input().split())
ans = N*(N-1)//2 + M*(M-1)//2
print(ans)

Solution (Python):
N,M=map(int,input().split())
print(N*(N-1)//2+M*(M-1)//2)

Solution (Python):
a,b=map(int,input().split())
print(a*(a-1)//2+b*(b-1)//2)

Solution (Python):
import sys
input = sys.stdin.buffer.readline

N, M = map(int, input().split())

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

Solution (Python):
N, M = map(int, input().split())
print(N * (N - 1) // 2 + M * (M - 1) // 2)

Solution (Python):
n, m = map(int, input().split())
ans = n*(n-1)//2 + m*(m-1)//2 
print(ans)

Solution (Python):
N,M = map(int,input().split())

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

Solution (Python):
n,m = map(int, input().split())
print((n*(n-1))//2  + (m*(m-1))//2)

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    N, M = map(int, input().split())
    Ans = N * (N - 1) // 2
    Ans += M * (M - 1) // 2
    print(Ans)

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
n, m = map(int, input().split())
ans = n * (n - 1) // 2
ans += m * (m - 1) // 2
print(ans)

Solution (Python):
N, M = map(int, input().split())
print(N * (N - 1) // 2 + M * (M - 1) // 2)

Solution (Python):
n, m = map(int, input().split())
print(n * (n - 1) // 2 + m * (m - 1) // 2)

Solution (Python):
N,M = map(int,input().split())
print(N*(N-1)//2 + M*(M-1)//2)

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):


iim = lambda: map(int, input().rstrip().split())

def resolve():
    N, M = iim()

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

if __name__ == "__main__":
    resolve()

Solution (Python):
n, m = map(int,input().split())
print(n*(n-1)//2 + m*(m-1)//2)

Solution (Python):
n,m = map(int,input().split())

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

Solution (Python):
n,m = map(int,input().split())

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

Solution (Python):
N,M = map(int,input().split())

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

Solution (Python):
N,M=map(int,input().split())
print((N-1)*N//2+(M-1)*M//2)

Solution (Python):
N, M = map(int, input().split())
print(N * (N - 1) // 2 + M * (M - 1) // 2)

Solution (Python):
n, m = map(int, input().split())
print(n*(n-1)//2 + m*(m-1)//2)

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
import math
a,b = map(int, input().split())
ans = a*(a-1)//2 + b*(b-1)//2
print(ans)

Solution (Python):
N,M= map(int,input().split())

ans = 0
ans += N*(N-1)//2
ans += M*(M-1)//2

print(ans)

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a,b = m()

print((a*(a-1))//2 + (b*(b-1))//2)

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
n, m = map(int, input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
n,m = map(int,input().split())
print((n*(n-1))//2+(m*(m-1))//2)

Solution (Python):
N,M=[int(i) for i in input().split(" ")]

retval=0
retval+=(N-1)*N//2
retval+=(M-1)*M//2
print(retval)

Solution (Python):
n,m = map(int, input().split())
ans = 0
ans += n*(n-1)//2
ans += m*(m-1)//2
print(ans)

Solution (Python):



import sys
sys.setrecursionlimit(10000000)


dxdy=((1,0),(0,1))

def pin(type=int):
    return map(type,input().rstrip().split())
    
def resolve():
    N,M=pin()
    print(N*(N-1)//2+M*(M-1)//2)
"""         


"""
"""
お前カッコ閉じるの忘れてるだろ
"""

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2 1"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """4 3"""
        output = """9"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1 1"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """13 3"""
        output = """81"""
        self.assertIO(input, output)

    def test_入力例_5(self):
        input = """0 3"""
        output = """3"""
        self.assertIO(input, output)

if __name__=="__main__":resolve()

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
N, M = [int(n) for n in input().split()]
print(N*(N-1)//2 + M*(M-1)//2)

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n,m = inpm()
    print(n*(n-1)//2+m*(m-1)//2)
    
if __name__ == "__main__":
    main()

Solution (Python):
import sys
input=sys.stdin.readline
n,m=map(int,input().split())
ans=n*(n-1)//2+m*(m-1)//2
print(ans)

Solution (Python):
N,M = map(int,input().split())
print(N*(N-1)//2+M*(M-1)//2)

Solution (Python):
N, M=map(int, input().split())
print(N*(N-1)//2+M*(M-1)//2)

Solution (Python):
import sys
n, m = [int(i) for i in sys.stdin.readline().split()]
print(n * (n-1) // 2 + m * (m-1) // 2)

Solution (Python):
import sys
from fractions import gcd
from itertools import groupby as gb
from itertools import permutations as perm
from itertools import combinations as comb
from collections import Counter as C
from collections import defaultdict as dd
sys.setrecursionlimit(10**5)
def y(f):
    if f:
        print('Yes')
    else:
        print('No')
def Y(f):
    if f:
        print('YES')
    else:
        print('NO')
def Z(f):
    if f:
        print('Yay!')
    else:
        print(':(')
def ispow(n):
    if int(n**.5)**2==n:
        return True
    return False

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

Solution (Python):
n,m = map(int, input().split( ))
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
n, m = list(map(int, input().split()))
ans = n * (n - 1) // 2 + m * (m - 1) // 2
print(ans)

Solution (Python):
n,m=map(int,input().split())
print(((n-1)*n)//2+((m-1)*m)//2)

Solution (Python):
n, m = map(int, input().split())
print(n * (n-1) // 2 + m * (m-1) // 2)

Solution (Python):
n,m = map(int,input().split())
ans = n*(n-1)//2 + m*(m-1)//2
print(ans)

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


N, M = list(map(int, sys.stdin.buffer.readline().split()))
ans = 0
if N > 1:
    ans += N * (N - 1) // 2
if M > 1:
    ans += M * (M - 1) // 2
print(ans)

Solution (Python):
n,m = map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
N, M = map(int, input().split())

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

Solution (Python):
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()


N, M = map(int, input().split())

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

Solution (Python):

N,M = map(int,input().split())

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

Solution (Python):
a, b = map(int,input().split())
print((a*(a-1)//2) + (b*(b-1)//2))

Solution (Python):
n, m = [int(i) for i in input().split()]
print(n*(n-1)//2+m*(m-1)//2)

Solution (Python):
A, B = map(int, input().split())

print(A * (A-1) // 2 + B * (B-1) // 2)

Solution (Python):
N, M = list(map(int, input().split()))
ans = N*(N-1)//2+M*(M-1)//2
print(ans)

Solution (Python):
N,M=map(int,input().split())
print(N*(N-1)//2+M*(M-1)//2)

Solution (Python):
n, m = map(int, input().split())
ans = n * (n - 1) // 2 + m * (m - 1) // 2
print(ans)

Solution (Python):
N, M = map(int, input().split())
print(N*(N-1)//2 + M*(M-1)//2)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    print(N*(N-1)//2+M*(M-1)//2)

if __name__ == '__main__':
    main()

Solution (Python):
n,m = map(int, input().split())

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

Solution (Python):
N, M = map(int, input().split())
print(N * (N-1) // 2 + M * (M-1) // 2)

Solution (Python):
def c(i):
  return i * (i-1) // 2

a, b = input().split()
a, b = int(a), int(b)

print(c(a) + c(b))