import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Main
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static int tc=1;
    static String[] s;

    public static long[] ila(String[] s){
        long[] array=new long[s.length];
        for(int i=0;i<array.length;i++)
            array[i]=Long.parseLong(s[i]);
        return array;
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        tc=1;
        t:
        for(int z=1;z<=tc;z++){
        	String[] s=br.readLine().split(" ");
        	int N = Integer.parseInt(s[0]);
        	int M = Integer.parseInt(s[1]);
        	long ans = ((long)N*(N-1))>>1;
        	ans += ((long)M*(M-1))>>1;
        	System.out.println(ans);
        }
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java import java.math.*; math.* java public class Main
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static int tc=1;
    static String[] s;

    public static long[] ila(String[] s){
        long[] array=new long[s.length];
        for(int i=0;i<array.length;i++)
            array[i]=Long.parseLong(s[i]);
        return array;
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        tc=1;
        t:
        for(int z=1;z<=tc;z++){
        	String[] s=br.readLine().split(" ");
        	int N = Integer.parseInt(s[0]);
        	int M = Integer.parseInt(s[1]);
        	long ans = ((long)N*(N-1))>>1;
        	ans += ((long)M*(M-1))>>1;
        	System.out.println(ans);
        }
    }
} Main static BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) static int tc=1; tc 1 static String[] s; s public static long[] ila(String[] s){
        long[] array=new long[s.length];
        for(int i=0;i<array.length;i++)
            array[i]=Long.parseLong(s[i]);
        return array;
    } ila {
        long[] array=new long[s.length];
        for(int i=0;i<array.length;i++)
            array[i]=Long.parseLong(s[i]);
        return array;
    } long[] array=new long[s.length]; array new long[s.length] s.length s s.length for(int i=0;i<array.length;i++)
            array[i]=Long.parseLong(s[i]); int i=0; int i=0; i 0 i<array.length i array.length array array.length i++ i++ i array[i]=Long.parseLong(s[i]); array[i]=Long.parseLong(s[i]) array[i] array i Long.parseLong(s[i]) Long.parseLong Long s[i] s i return array; array String[] s s public static void main (String[] args) throws java.lang.Exception
    {
        tc=1;
        t:
        for(int z=1;z<=tc;z++){
        	String[] s=br.readLine().split(" ");
        	int N = Integer.parseInt(s[0]);
        	int M = Integer.parseInt(s[1]);
        	long ans = ((long)N*(N-1))>>1;
        	ans += ((long)M*(M-1))>>1;
        	System.out.println(ans);
        }
    } main {
        tc=1;
        t:
        for(int z=1;z<=tc;z++){
        	String[] s=br.readLine().split(" ");
        	int N = Integer.parseInt(s[0]);
        	int M = Integer.parseInt(s[1]);
        	long ans = ((long)N*(N-1))>>1;
        	ans += ((long)M*(M-1))>>1;
        	System.out.println(ans);
        }
    } tc=1 tc 1 String[] args args public class Main
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static int tc=1;
    static String[] s;

    public static long[] ila(String[] s){
        long[] array=new long[s.length];
        for(int i=0;i<array.length;i++)
            array[i]=Long.parseLong(s[i]);
        return array;
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        tc=1;
        t:
        for(int z=1;z<=tc;z++){
        	String[] s=br.readLine().split(" ");
        	int N = Integer.parseInt(s[0]);
        	int M = Integer.parseInt(s[1]);
        	long ans = ((long)N*(N-1))>>1;
        	ans += ((long)M*(M-1))>>1;
        	System.out.println(ans);
        }
    }
} public class Main
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static int tc=1;
    static String[] s;

    public static long[] ila(String[] s){
        long[] array=new long[s.length];
        for(int i=0;i<array.length;i++)
            array[i]=Long.parseLong(s[i]);
        return array;
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        tc=1;
        t:
        for(int z=1;z<=tc;z++){
        	String[] s=br.readLine().split(" ");
        	int N = Integer.parseInt(s[0]);
        	int M = Integer.parseInt(s[1]);
        	long ans = ((long)N*(N-1))>>1;
        	ans += ((long)M*(M-1))>>1;
        	System.out.println(ans);
        }
    }
} Main
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Main
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static int tc=1;
    static String[] s;

    public static long[] ila(String[] s){
        long[] array=new long[s.length];
        for(int i=0;i<array.length;i++)
            array[i]=Long.parseLong(s[i]);
        return array;
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        tc=1;
        t:
        for(int z=1;z<=tc;z++){
        	String[] s=br.readLine().split(" ");
        	int N = Integer.parseInt(s[0]);
        	int M = Integer.parseInt(s[1]);
        	long ans = ((long)N*(N-1))>>1;
        	ans += ((long)M*(M-1))>>1;
        	System.out.println(ans);
        }
    }
}