import java.util.*;
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 

public class Main{

    static int comb(int m,int n)
    {
        int res=1;

        if(n>m-n)
            n=m-n;

        for(int i=0;i<n;i++)
        {
            res*=(m-i);
            res/=(i+1);
        }
        return res;
    }
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);

        int m= in.nextInt();
        int n = in.nextInt();

        int total_ways=0;

        if(m>=2)
            total_ways+=comb(m,2);

        if(n>=2)
            total_ways+=comb(n,2);

        System.out.println(total_ways);
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz