import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int c = sc.nextInt();
    int d = sc.nextInt();
    c = c-1;
    d = d-1;
    c = (c*(c+1))/2;
    d = (d*(d+1))/2;
    c = c+d;
    System.out.println(c);
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int c = sc.nextInt();
    int d = sc.nextInt();
    c = c-1;
    d = d-1;
    c = (c*(c+1))/2;
    d = (d*(d+1))/2;
    c = c+d;
    System.out.println(c);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int c = sc.nextInt();
    int d = sc.nextInt();
    c = c-1;
    d = d-1;
    c = (c*(c+1))/2;
    d = (d*(d+1))/2;
    c = c+d;
    System.out.println(c);
  } main {
    Scanner sc = new Scanner(System.in);
    int c = sc.nextInt();
    int d = sc.nextInt();
    c = c-1;
    d = d-1;
    c = (c*(c+1))/2;
    d = (d*(d+1))/2;
    c = c+d;
    System.out.println(c);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc c = c-1 c c-1 c 1 d = d-1 d d-1 d 1 c = (c*(c+1))/2 c (c*(c+1))/2 (c*(c+1)) c (c+1) c 1 2 d = (d*(d+1))/2 d (d*(d+1))/2 (d*(d+1)) d (d+1) d 1 2 c = c+d c c+d c d System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int c = sc.nextInt();
    int d = sc.nextInt();
    c = c-1;
    d = d-1;
    c = (c*(c+1))/2;
    d = (d*(d+1))/2;
    c = c+d;
    System.out.println(c);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int c = sc.nextInt();
    int d = sc.nextInt();
    c = c-1;
    d = d-1;
    c = (c*(c+1))/2;
    d = (d*(d+1))/2;
    c = c+d;
    System.out.println(c);
  }
} Main
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int c = sc.nextInt();
    int d = sc.nextInt();
    c = c-1;
    d = d-1;
    c = (c*(c+1))/2;
    d = (d*(d+1))/2;
    c = c+d;
    System.out.println(c);
  }
}