import java.util.Scanner;
public class Main{
 public static void main(String[] args) {
   Scanner kbd = new Scanner(System.in);
  int n=kbd.nextInt();
  int m=kbd.nextInt();

  int x;
  if(n==0){
    x=(m*(m-1))/2;
  }else if(m==0){
    x=(n*(n-1))/2;
  }else{
  x=(n*(n-1))/2+(m*(m-1))/2;
}
  System.out.println(x);
}
} import java.util.Scanner; Scanner java.util public class Main{
 public static void main(String[] args) {
   Scanner kbd = new Scanner(System.in);
  int n=kbd.nextInt();
  int m=kbd.nextInt();

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

  int x;
  if(n==0){
    x=(m*(m-1))/2;
  }else if(m==0){
    x=(n*(n-1))/2;
  }else{
  x=(n*(n-1))/2+(m*(m-1))/2;
}
  System.out.println(x);
} main {
   Scanner kbd = new Scanner(System.in);
  int n=kbd.nextInt();
  int m=kbd.nextInt();

  int x;
  if(n==0){
    x=(m*(m-1))/2;
  }else if(m==0){
    x=(n*(n-1))/2;
  }else{
  x=(n*(n-1))/2+(m*(m-1))/2;
}
  System.out.println(x);
} Scanner kbd = new Scanner(System.in); kbd new Scanner(System.in) int n=kbd.nextInt(); n kbd.nextInt() kbd.nextInt kbd int m=kbd.nextInt(); m kbd.nextInt() kbd.nextInt kbd int x; x if(n==0){
    x=(m*(m-1))/2;
  }else if(m==0){
    x=(n*(n-1))/2;
  }else{
  x=(n*(n-1))/2+(m*(m-1))/2;
} n==0 n 0 {
    x=(m*(m-1))/2;
  } x=(m*(m-1))/2 x (m*(m-1))/2 (m*(m-1)) m (m-1) m 1 2 if(m==0){
    x=(n*(n-1))/2;
  }else{
  x=(n*(n-1))/2+(m*(m-1))/2;
} m==0 m 0 {
    x=(n*(n-1))/2;
  } x=(n*(n-1))/2 x (n*(n-1))/2 (n*(n-1)) n (n-1) n 1 2 {
  x=(n*(n-1))/2+(m*(m-1))/2;
} x=(n*(n-1))/2+(m*(m-1))/2 x (n*(n-1))/2+(m*(m-1))/2 (n*(n-1))/2 (n*(n-1)) n (n-1) n 1 2 (m*(m-1))/2 (m*(m-1)) m (m-1) m 1 2 System.out.println(x) System.out.println System.out System System.out x String[] args args public class Main{
 public static void main(String[] args) {
   Scanner kbd = new Scanner(System.in);
  int n=kbd.nextInt();
  int m=kbd.nextInt();

  int x;
  if(n==0){
    x=(m*(m-1))/2;
  }else if(m==0){
    x=(n*(n-1))/2;
  }else{
  x=(n*(n-1))/2+(m*(m-1))/2;
}
  System.out.println(x);
}
} public class Main{
 public static void main(String[] args) {
   Scanner kbd = new Scanner(System.in);
  int n=kbd.nextInt();
  int m=kbd.nextInt();

  int x;
  if(n==0){
    x=(m*(m-1))/2;
  }else if(m==0){
    x=(n*(n-1))/2;
  }else{
  x=(n*(n-1))/2+(m*(m-1))/2;
}
  System.out.println(x);
}
} Main
import java.util.Scanner;
public class Main{
 public static void main(String[] args) {
   Scanner kbd = new Scanner(System.in);
  int n=kbd.nextInt();
  int m=kbd.nextInt();

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