//
//  main.swift
//  AtCoderSwiftSample
//
//  Created by Yuga Namba on 2020/03/25.
//  Copyright © 2020 Yuga Namba. All rights reserved.
//

import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

prefix operator * 
prefix func * <T> (a: [T]) -> (T, T) { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T) { return (a[0], a[1], a[2]) }

let (n, m) = *readInts()

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

print(ans)



