import java.util.*;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int count1 = 0;
    int count2 = 0;

    if (n>=2) {
      count1 = (n*(n-1)) / 2 ;
    }

    if (m>=2) {
      count2 = (m*(m-1)) / 2 ;
    }

    System.out.println(count1 + count2);

  }
} import java.util.*; util.* java public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int count1 = 0;
    int count2 = 0;

    if (n>=2) {
      count1 = (n*(n-1)) / 2 ;
    }

    if (m>=2) {
      count2 = (m*(m-1)) / 2 ;
    }

    System.out.println(count1 + count2);

  }
} Main public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int count1 = 0;
    int count2 = 0;

    if (n>=2) {
      count1 = (n*(n-1)) / 2 ;
    }

    if (m>=2) {
      count2 = (m*(m-1)) / 2 ;
    }

    System.out.println(count1 + count2);

  } main {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int count1 = 0;
    int count2 = 0;

    if (n>=2) {
      count1 = (n*(n-1)) / 2 ;
    }

    if (m>=2) {
      count2 = (m*(m-1)) / 2 ;
    }

    System.out.println(count1 + count2);

  } 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 int count1 = 0; count1 0 int count2 = 0; count2 0 if (n>=2) {
      count1 = (n*(n-1)) / 2 ;
    } n>=2 n 2 {
      count1 = (n*(n-1)) / 2 ;
    } count1 = (n*(n-1)) / 2 count1 (n*(n-1)) / 2 (n*(n-1)) n (n-1) n 1 2 if (m>=2) {
      count2 = (m*(m-1)) / 2 ;
    } m>=2 m 2 {
      count2 = (m*(m-1)) / 2 ;
    } count2 = (m*(m-1)) / 2 count2 (m*(m-1)) / 2 (m*(m-1)) m (m-1) m 1 2 System.out.println(count1 + count2) System.out.println System.out System System.out count1 + count2 count1 count2 String[] args args public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int count1 = 0;
    int count2 = 0;

    if (n>=2) {
      count1 = (n*(n-1)) / 2 ;
    }

    if (m>=2) {
      count2 = (m*(m-1)) / 2 ;
    }

    System.out.println(count1 + count2);

  }
} public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int count1 = 0;
    int count2 = 0;

    if (n>=2) {
      count1 = (n*(n-1)) / 2 ;
    }

    if (m>=2) {
      count2 = (m*(m-1)) / 2 ;
    }

    System.out.println(count1 + count2);

  }
} Main
import java.util.*;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int count1 = 0;
    int count2 = 0;

    if (n>=2) {
      count1 = (n*(n-1)) / 2 ;
    }

    if (m>=2) {
      count2 = (m*(m-1)) / 2 ;
    }

    System.out.println(count1 + count2);

  }
}
