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

public class Main{
    public static void main(String[] args){
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

                String[] ss=br.readLine().split(" ");
               int n=Integer.parseInt(ss[0]);
               int m=Integer.parseInt(ss[1]);
               System.out.println((n*(n-1))/2 + m*(m-1)/2);



        }catch(Exception e){
            System.out.println("kkkk");
        }
    }
    static class pair{
        int a,b;
        public pair(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

                String[] ss=br.readLine().split(" ");
               int n=Integer.parseInt(ss[0]);
               int m=Integer.parseInt(ss[1]);
               System.out.println((n*(n-1))/2 + m*(m-1)/2);



        }catch(Exception e){
            System.out.println("kkkk");
        }
    }
    static class pair{
        int a,b;
        public pair(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
} Main public static void main(String[] args){
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

                String[] ss=br.readLine().split(" ");
               int n=Integer.parseInt(ss[0]);
               int m=Integer.parseInt(ss[1]);
               System.out.println((n*(n-1))/2 + m*(m-1)/2);



        }catch(Exception e){
            System.out.println("kkkk");
        }
    } main {
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

                String[] ss=br.readLine().split(" ");
               int n=Integer.parseInt(ss[0]);
               int m=Integer.parseInt(ss[1]);
               System.out.println((n*(n-1))/2 + m*(m-1)/2);



        }catch(Exception e){
            System.out.println("kkkk");
        }
    } try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

                String[] ss=br.readLine().split(" ");
               int n=Integer.parseInt(ss[0]);
               int m=Integer.parseInt(ss[1]);
               System.out.println((n*(n-1))/2 + m*(m-1)/2);



        }catch(Exception e){
            System.out.println("kkkk");
        } catch(Exception e){
            System.out.println("kkkk");
        } Exception e {
            System.out.println("kkkk");
        } System.out.println("kkkk") System.out.println System.out System System.out "kkkk" {
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

                String[] ss=br.readLine().split(" ");
               int n=Integer.parseInt(ss[0]);
               int m=Integer.parseInt(ss[1]);
               System.out.println((n*(n-1))/2 + m*(m-1)/2);



        } BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] ss=br.readLine().split(" "); ss br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n=Integer.parseInt(ss[0]); n Integer.parseInt(ss[0]) Integer.parseInt Integer ss[0] ss 0 int m=Integer.parseInt(ss[1]); m Integer.parseInt(ss[1]) Integer.parseInt Integer ss[1] ss 1 System.out.println((n*(n-1))/2 + m*(m-1)/2) System.out.println System.out System System.out (n*(n-1))/2 + m*(m-1)/2 (n*(n-1))/2 (n*(n-1)) n (n-1) n 1 2 m*(m-1)/2 m*(m-1) m (m-1) m 1 2 String[] args args static class pair{
        int a,b;
        public pair(int a,int b){
            this.a=a;
            this.b=b;
        }
    } pair int a a b; b public pair(int a,int b){
            this.a=a;
            this.b=b;
        } pair {
            this.a=a;
            this.b=b;
        } this.a=a this.a this this.a a this.b=b this.b this this.b b int a a int b b public class Main{
    public static void main(String[] args){
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

                String[] ss=br.readLine().split(" ");
               int n=Integer.parseInt(ss[0]);
               int m=Integer.parseInt(ss[1]);
               System.out.println((n*(n-1))/2 + m*(m-1)/2);



        }catch(Exception e){
            System.out.println("kkkk");
        }
    }
    static class pair{
        int a,b;
        public pair(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
} public class Main{
    public static void main(String[] args){
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

                String[] ss=br.readLine().split(" ");
               int n=Integer.parseInt(ss[0]);
               int m=Integer.parseInt(ss[1]);
               System.out.println((n*(n-1))/2 + m*(m-1)/2);



        }catch(Exception e){
            System.out.println("kkkk");
        }
    }
    static class pair{
        int a,b;
        public pair(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
} Main

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

public class Main{
    public static void main(String[] args){
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

                String[] ss=br.readLine().split(" ");
               int n=Integer.parseInt(ss[0]);
               int m=Integer.parseInt(ss[1]);
               System.out.println((n*(n-1))/2 + m*(m-1)/2);



        }catch(Exception e){
            System.out.println("kkkk");
        }
    }
    static class pair{
        int a,b;
        public pair(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
}