import java.util.*;
import java.math.*;

public class Main {

  static int min = 10000;

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

    long x = kaijo(n);
    long y = kaijo(m);

    System.out.println(x+y);



  }

  public static long kaijo (long x) {
    long sum = 0;
    while (x > 0) {
      x--;
      sum += x;
    }
    return sum;
  }

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

  static int min = 10000;

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

    long x = kaijo(n);
    long y = kaijo(m);

    System.out.println(x+y);



  }

  public static long kaijo (long x) {
    long sum = 0;
    while (x > 0) {
      x--;
      sum += x;
    }
    return sum;
  }

} Main static int min = 10000; min 10000 public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long m = sc.nextLong();

    long x = kaijo(n);
    long y = kaijo(m);

    System.out.println(x+y);



  } main {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long m = sc.nextLong();

    long x = kaijo(n);
    long y = kaijo(m);

    System.out.println(x+y);



  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long m = sc.nextLong(); m sc.nextLong() sc.nextLong sc long x = kaijo(n); x kaijo(n) kaijo n long y = kaijo(m); y kaijo(m) kaijo m System.out.println(x+y) System.out.println System.out System System.out x+y x y String[] args args public static long kaijo (long x) {
    long sum = 0;
    while (x > 0) {
      x--;
      sum += x;
    }
    return sum;
  } kaijo {
    long sum = 0;
    while (x > 0) {
      x--;
      sum += x;
    }
    return sum;
  } long sum = 0; sum 0 while (x > 0) {
      x--;
      sum += x;
    } x > 0 x 0 {
      x--;
      sum += x;
    } x-- x sum += x sum x return sum; sum long x x public class Main {

  static int min = 10000;

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

    long x = kaijo(n);
    long y = kaijo(m);

    System.out.println(x+y);



  }

  public static long kaijo (long x) {
    long sum = 0;
    while (x > 0) {
      x--;
      sum += x;
    }
    return sum;
  }

} public class Main {

  static int min = 10000;

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

    long x = kaijo(n);
    long y = kaijo(m);

    System.out.println(x+y);



  }

  public static long kaijo (long x) {
    long sum = 0;
    while (x > 0) {
      x--;
      sum += x;
    }
    return sum;
  }

} Main
import java.util.*;
import java.math.*;

public class Main {

  static int min = 10000;

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

    long x = kaijo(n);
    long y = kaijo(m);

    System.out.println(x+y);



  }

  public static long kaijo (long x) {
    long sum = 0;
    while (x > 0) {
      x--;
      sum += x;
    }
    return sum;
  }

}
