import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		n = n > 1 ? combination(n, 2) : 0;
		m = m > 1 ? combination(m, 2) : 0;
		System.out.println(n + m);
	}
	
	//nCr
	public static int combination(int n, int r){
		int num = 1;
		for(int i=1; i<=r; i++){
			num = num * (n - i + 1) / i;
		}
		return num;
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		n = n > 1 ? combination(n, 2) : 0;
		m = m > 1 ? combination(m, 2) : 0;
		System.out.println(n + m);
	}
	
	//nCr
	public static int combination(int n, int r){
		int num = 1;
		for(int i=1; i<=r; i++){
			num = num * (n - i + 1) / i;
		}
		return num;
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		n = n > 1 ? combination(n, 2) : 0;
		m = m > 1 ? combination(m, 2) : 0;
		System.out.println(n + m);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		n = n > 1 ? combination(n, 2) : 0;
		m = m > 1 ? combination(m, 2) : 0;
		System.out.println(n + m);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc n = n > 1 ? combination(n, 2) : 0 n n > 1 ? combination(n, 2) : 0 n > 1 n 1 combination(n, 2) combination n 2 0 m = m > 1 ? combination(m, 2) : 0 m m > 1 ? combination(m, 2) : 0 m > 1 m 1 combination(m, 2) combination m 2 0 System.out.println(n + m) System.out.println System.out System System.out n + m n m String[] args args //nCr
	public static int combination(int n, int r){
		int num = 1;
		for(int i=1; i<=r; i++){
			num = num * (n - i + 1) / i;
		}
		return num;
	} combination {
		int num = 1;
		for(int i=1; i<=r; i++){
			num = num * (n - i + 1) / i;
		}
		return num;
	} int num = 1; num 1 for(int i=1; i<=r; i++){
			num = num * (n - i + 1) / i;
		} int i=1; int i=1; i 1 i<=r i r i++ i++ i {
			num = num * (n - i + 1) / i;
		} {
			num = num * (n - i + 1) / i;
		} num = num * (n - i + 1) / i num num * (n - i + 1) / i num * (n - i + 1) num (n - i + 1) n - i n i 1 i return num; num int n n int r r public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		n = n > 1 ? combination(n, 2) : 0;
		m = m > 1 ? combination(m, 2) : 0;
		System.out.println(n + m);
	}
	
	//nCr
	public static int combination(int n, int r){
		int num = 1;
		for(int i=1; i<=r; i++){
			num = num * (n - i + 1) / i;
		}
		return num;
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		n = n > 1 ? combination(n, 2) : 0;
		m = m > 1 ? combination(m, 2) : 0;
		System.out.println(n + m);
	}
	
	//nCr
	public static int combination(int n, int r){
		int num = 1;
		for(int i=1; i<=r; i++){
			num = num * (n - i + 1) / i;
		}
		return num;
	}
} Main
import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		n = n > 1 ? combination(n, 2) : 0;
		m = m > 1 ? combination(m, 2) : 0;
		System.out.println(n + m);
	}
	
	//nCr
	public static int combination(int n, int r){
		int num = 1;
		for(int i=1; i<=r; i++){
			num = num * (n - i + 1) / i;
		}
		return num;
	}
}
