    import java.io.*;
	import java.util.*;
    class Main
    {
      public static void main(String args[])throws IOException
      {
        int i,s1=0,s2=0,s,m,n;
        BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
        Scanner sc =new Scanner(System.in);
        //n=Integer.parseInt(input.readLine());
        //m=Integer.parseInt(input.readLine());
        n=sc.nextInt();
        m=sc.nextInt();
        for(i=1;i<m;i++)
        {
          s1=s1+i;
        }
        for(i=1;i<n;i++)
        {
          s2=s2+i;
        }
        s=s1+s2;
        System.out.println(s);
      }
    } import java.io.*; io.* java import java.util.*; util.* java class Main
    {
      public static void main(String args[])throws IOException
      {
        int i,s1=0,s2=0,s,m,n;
        BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
        Scanner sc =new Scanner(System.in);
        //n=Integer.parseInt(input.readLine());
        //m=Integer.parseInt(input.readLine());
        n=sc.nextInt();
        m=sc.nextInt();
        for(i=1;i<m;i++)
        {
          s1=s1+i;
        }
        for(i=1;i<n;i++)
        {
          s2=s2+i;
        }
        s=s1+s2;
        System.out.println(s);
      }
    } Main public static void main(String args[])throws IOException
      {
        int i,s1=0,s2=0,s,m,n;
        BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
        Scanner sc =new Scanner(System.in);
        //n=Integer.parseInt(input.readLine());
        //m=Integer.parseInt(input.readLine());
        n=sc.nextInt();
        m=sc.nextInt();
        for(i=1;i<m;i++)
        {
          s1=s1+i;
        }
        for(i=1;i<n;i++)
        {
          s2=s2+i;
        }
        s=s1+s2;
        System.out.println(s);
      } main {
        int i,s1=0,s2=0,s,m,n;
        BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
        Scanner sc =new Scanner(System.in);
        //n=Integer.parseInt(input.readLine());
        //m=Integer.parseInt(input.readLine());
        n=sc.nextInt();
        m=sc.nextInt();
        for(i=1;i<m;i++)
        {
          s1=s1+i;
        }
        for(i=1;i<n;i++)
        {
          s2=s2+i;
        }
        s=s1+s2;
        System.out.println(s);
      } int i i s1=0 s1 0 s2=0 s2 0 s s m m n; n BufferedReader input=new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) Scanner sc =new Scanner(System.in); sc new Scanner(System.in) n=sc.nextInt() n sc.nextInt() sc.nextInt sc m=sc.nextInt() m sc.nextInt() sc.nextInt sc for(i=1;i<m;i++)
        {
          s1=s1+i;
        } i=1; i=1 i 1 i<m i m i++ i++ i {
          s1=s1+i;
        } {
          s1=s1+i;
        } s1=s1+i s1 s1+i s1 i for(i=1;i<n;i++)
        {
          s2=s2+i;
        } i=1; i=1 i 1 i<n i n i++ i++ i {
          s2=s2+i;
        } {
          s2=s2+i;
        } s2=s2+i s2 s2+i s2 i s=s1+s2 s s1+s2 s1 s2 System.out.println(s) System.out.println System.out System System.out s String args[] args
    import java.io.*;
	import java.util.*;
    class Main
    {
      public static void main(String args[])throws IOException
      {
        int i,s1=0,s2=0,s,m,n;
        BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
        Scanner sc =new Scanner(System.in);
        //n=Integer.parseInt(input.readLine());
        //m=Integer.parseInt(input.readLine());
        n=sc.nextInt();
        m=sc.nextInt();
        for(i=1;i<m;i++)
        {
          s1=s1+i;
        }
        for(i=1;i<n;i++)
        {
          s2=s2+i;
        }
        s=s1+s2;
        System.out.println(s);
      }
    }