import java.util.*;

public class Main{

  static int factorial(int n) {
    if (n == 0) {
      return 1;
    }
    return n * factorial(n - 1);
  }

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());

    if((n == 1 && m == 1)||(n == 0 && m == 0))  System.out.println(0);
    else if(n == 1 || n == 0) System.out.println(m * (m - 1) / 2);
    else if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2);
  }
} import java.util.*; util.* java public class Main{

  static int factorial(int n) {
    if (n == 0) {
      return 1;
    }
    return n * factorial(n - 1);
  }

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());

    if((n == 1 && m == 1)||(n == 0 && m == 0))  System.out.println(0);
    else if(n == 1 || n == 0) System.out.println(m * (m - 1) / 2);
    else if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2);
  }
} Main static int factorial(int n) {
    if (n == 0) {
      return 1;
    }
    return n * factorial(n - 1);
  } factorial {
    if (n == 0) {
      return 1;
    }
    return n * factorial(n - 1);
  } if (n == 0) {
      return 1;
    } n == 0 n 0 {
      return 1;
    } return 1; 1 return n * factorial(n - 1); n * factorial(n - 1) n factorial(n - 1) factorial n - 1 n 1 int n n public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());

    if((n == 1 && m == 1)||(n == 0 && m == 0))  System.out.println(0);
    else if(n == 1 || n == 0) System.out.println(m * (m - 1) / 2);
    else if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2);
  } main {
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());

    if((n == 1 && m == 1)||(n == 0 && m == 0))  System.out.println(0);
    else if(n == 1 || n == 0) System.out.println(m * (m - 1) / 2);
    else if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if((n == 1 && m == 1)||(n == 0 && m == 0))  System.out.println(0);
    else if(n == 1 || n == 0) System.out.println(m * (m - 1) / 2);
    else if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2); (n == 1 && m == 1)||(n == 0 && m == 0) (n == 1 && m == 1) n == 1 n 1 m == 1 m 1 (n == 0 && m == 0) n == 0 n 0 m == 0 m 0 System.out.println(0) System.out.println System.out System System.out 0 if(n == 1 || n == 0) System.out.println(m * (m - 1) / 2);
    else if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2); n == 1 || n == 0 n == 1 n 1 n == 0 n 0 System.out.println(m * (m - 1) / 2) System.out.println System.out System System.out m * (m - 1) / 2 m * (m - 1) m (m - 1) m 1 2 if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2); m == 1 || m == 0 m == 1 m 1 m == 0 m 0 System.out.println(n * (n - 1) / 2) System.out.println System.out System System.out n * (n - 1) / 2 n * (n - 1) n (n - 1) n 1 2 System.out.println(m*(m-1)/2 + n*(n-1)/2) System.out.println System.out System System.out m*(m-1)/2 + n*(n-1)/2 m*(m-1)/2 m*(m-1) m (m-1) m 1 2 n*(n-1)/2 n*(n-1) n (n-1) n 1 2 String[] args args public class Main{

  static int factorial(int n) {
    if (n == 0) {
      return 1;
    }
    return n * factorial(n - 1);
  }

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());

    if((n == 1 && m == 1)||(n == 0 && m == 0))  System.out.println(0);
    else if(n == 1 || n == 0) System.out.println(m * (m - 1) / 2);
    else if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2);
  }
} public class Main{

  static int factorial(int n) {
    if (n == 0) {
      return 1;
    }
    return n * factorial(n - 1);
  }

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());

    if((n == 1 && m == 1)||(n == 0 && m == 0))  System.out.println(0);
    else if(n == 1 || n == 0) System.out.println(m * (m - 1) / 2);
    else if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2);
  }
} Main
import java.util.*;

public class Main{

  static int factorial(int n) {
    if (n == 0) {
      return 1;
    }
    return n * factorial(n - 1);
  }

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());

    if((n == 1 && m == 1)||(n == 0 && m == 0))  System.out.println(0);
    else if(n == 1 || n == 0) System.out.println(m * (m - 1) / 2);
    else if(m == 1 || m == 0) System.out.println(n * (n - 1) / 2);
    else 
      System.out.println(m*(m-1)/2 + n*(n-1)/2);
  }
}
