import java.util.*;
class Main
{
  static long fact(int n)
  {
    long f=1;
    for(;n>0;n--)
      f*=n;
    return(f);
  }
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int M=sc.nextInt();long a,b;
    if(M==2)
      a=1;
    else
     a=(M*(M-1))/2;
    if(N==2)
       b=1;
    else
     b=(N*(N-1))/2;
    System.out.println(a+b);
  }
} import java.util.*; util.* java class Main
{
  static long fact(int n)
  {
    long f=1;
    for(;n>0;n--)
      f*=n;
    return(f);
  }
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int M=sc.nextInt();long a,b;
    if(M==2)
      a=1;
    else
     a=(M*(M-1))/2;
    if(N==2)
       b=1;
    else
     b=(N*(N-1))/2;
    System.out.println(a+b);
  }
} Main static long fact(int n)
  {
    long f=1;
    for(;n>0;n--)
      f*=n;
    return(f);
  } fact {
    long f=1;
    for(;n>0;n--)
      f*=n;
    return(f);
  } long f=1; f 1 for(;n>0;n--)
      f*=n; ; n>0 n 0 n-- n-- n f*=n; f*=n f n return(f); (f) int n n public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int M=sc.nextInt();long a,b;
    if(M==2)
      a=1;
    else
     a=(M*(M-1))/2;
    if(N==2)
       b=1;
    else
     b=(N*(N-1))/2;
    System.out.println(a+b);
  } main {
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int M=sc.nextInt();long a,b;
    if(M==2)
      a=1;
    else
     a=(M*(M-1))/2;
    if(N==2)
       b=1;
    else
     b=(N*(N-1))/2;
    System.out.println(a+b);
  } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int M=sc.nextInt(); M sc.nextInt() sc.nextInt sc long a a b; b if(M==2)
      a=1;
    else
     a=(M*(M-1))/2; M==2 M 2 a=1 a 1 a=(M*(M-1))/2 a (M*(M-1))/2 (M*(M-1)) M (M-1) M 1 2 if(N==2)
       b=1;
    else
     b=(N*(N-1))/2; N==2 N 2 b=1 b 1 b=(N*(N-1))/2 b (N*(N-1))/2 (N*(N-1)) N (N-1) N 1 2 System.out.println(a+b) System.out.println System.out System System.out a+b a b String args[] args
import java.util.*;
class Main
{
  static long fact(int n)
  {
    long f=1;
    for(;n>0;n--)
      f*=n;
    return(f);
  }
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int M=sc.nextInt();long a,b;
    if(M==2)
      a=1;
    else
     a=(M*(M-1))/2;
    if(N==2)
       b=1;
    else
     b=(N*(N-1))/2;
    System.out.println(a+b);
  }
}