import java.io.*;
import java.util.*;

public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), m = in.nextInt();
		System.out.println(ncr(m, 2) + ncr(n, 2));
	}
	static int ncr(int n, int r)
	{
		if(n < r)
			return 0;
		r = Math.min(n - r, r);
		int ans = 1;
		for(int i = 1; i <= r; ++i)
		{
			ans *= (n - r + i);
			ans /= i;
		}
		return ans;
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), m = in.nextInt();
		System.out.println(ncr(m, 2) + ncr(n, 2));
	}
	static int ncr(int n, int r)
	{
		if(n < r)
			return 0;
		r = Math.min(n - r, r);
		int ans = 1;
		for(int i = 1; i <= r; ++i)
		{
			ans *= (n - r + i);
			ans /= i;
		}
		return ans;
	}
} Main public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), m = in.nextInt();
		System.out.println(ncr(m, 2) + ncr(n, 2));
	} main {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), m = in.nextInt();
		System.out.println(ncr(m, 2) + ncr(n, 2));
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt() n in.nextInt() in.nextInt in m = in.nextInt(); m in.nextInt() in.nextInt in System.out.println(ncr(m, 2) + ncr(n, 2)) System.out.println System.out System System.out ncr(m, 2) + ncr(n, 2) ncr(m, 2) ncr m 2 ncr(n, 2) ncr n 2 String[] args args static int ncr(int n, int r)
	{
		if(n < r)
			return 0;
		r = Math.min(n - r, r);
		int ans = 1;
		for(int i = 1; i <= r; ++i)
		{
			ans *= (n - r + i);
			ans /= i;
		}
		return ans;
	} ncr {
		if(n < r)
			return 0;
		r = Math.min(n - r, r);
		int ans = 1;
		for(int i = 1; i <= r; ++i)
		{
			ans *= (n - r + i);
			ans /= i;
		}
		return ans;
	} if(n < r)
			return 0; n < r n r return 0; 0 r = Math.min(n - r, r) r Math.min(n - r, r) Math.min Math n - r n r r int ans = 1; ans 1 for(int i = 1; i <= r; ++i)
		{
			ans *= (n - r + i);
			ans /= i;
		} int i = 1; int i = 1; i 1 i <= r i r ++i ++i i {
			ans *= (n - r + i);
			ans /= i;
		} {
			ans *= (n - r + i);
			ans /= i;
		} ans *= (n - r + i) ans (n - r + i) n - r n r i ans /= i ans i return ans; ans int n n int r r public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), m = in.nextInt();
		System.out.println(ncr(m, 2) + ncr(n, 2));
	}
	static int ncr(int n, int r)
	{
		if(n < r)
			return 0;
		r = Math.min(n - r, r);
		int ans = 1;
		for(int i = 1; i <= r; ++i)
		{
			ans *= (n - r + i);
			ans /= i;
		}
		return ans;
	}
} public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), m = in.nextInt();
		System.out.println(ncr(m, 2) + ncr(n, 2));
	}
	static int ncr(int n, int r)
	{
		if(n < r)
			return 0;
		r = Math.min(n - r, r);
		int ans = 1;
		for(int i = 1; i <= r; ++i)
		{
			ans *= (n - r + i);
			ans /= i;
		}
		return ans;
	}
} Main
import java.io.*;
import java.util.*;

public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), m = in.nextInt();
		System.out.println(ncr(m, 2) + ncr(n, 2));
	}
	static int ncr(int n, int r)
	{
		if(n < r)
			return 0;
		r = Math.min(n - r, r);
		int ans = 1;
		for(int i = 1; i <= r; ++i)
		{
			ans *= (n - r + i);
			ans /= i;
		}
		return ans;
	}
}
