import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int cN,cM;
        cN = (n>1)?(n*(n-1))/2:0;
        cM = (m>1)?(m*(m-1))/2:0;
      /*  if(n>1){
            cN = (n*(n-1))/2;
        }else{
            cN = 0;
        }

        if(m>1){
            cM = (m*(m-1))/2;
        }else {
            cM = 0;
        }*/
        System.out.println(cM+cN);


    }
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int cN,cM;
        cN = (n>1)?(n*(n-1))/2:0;
        cM = (m>1)?(m*(m-1))/2:0;
      /*  if(n>1){
            cN = (n*(n-1))/2;
        }else{
            cN = 0;
        }

        if(m>1){
            cM = (m*(m-1))/2;
        }else {
            cM = 0;
        }*/
        System.out.println(cM+cN);


    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int cN,cM;
        cN = (n>1)?(n*(n-1))/2:0;
        cM = (m>1)?(m*(m-1))/2:0;
      /*  if(n>1){
            cN = (n*(n-1))/2;
        }else{
            cN = 0;
        }

        if(m>1){
            cM = (m*(m-1))/2;
        }else {
            cM = 0;
        }*/
        System.out.println(cM+cN);


    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int cN,cM;
        cN = (n>1)?(n*(n-1))/2:0;
        cM = (m>1)?(m*(m-1))/2:0;
      /*  if(n>1){
            cN = (n*(n-1))/2;
        }else{
            cN = 0;
        }

        if(m>1){
            cM = (m*(m-1))/2;
        }else {
            cM = 0;
        }*/
        System.out.println(cM+cN);


    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int cN cN cM; cM cN = (n>1)?(n*(n-1))/2:0 cN (n>1)?(n*(n-1))/2:0 (n>1) n 1 (n*(n-1))/2 (n*(n-1)) n (n-1) n 1 2 0 cM = (m>1)?(m*(m-1))/2:0 cM (m>1)?(m*(m-1))/2:0 (m>1) m 1 (m*(m-1))/2 (m*(m-1)) m (m-1) m 1 2 0 System.out.println(cM+cN) System.out.println System.out System System.out cM+cN cM cN String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int cN,cM;
        cN = (n>1)?(n*(n-1))/2:0;
        cM = (m>1)?(m*(m-1))/2:0;
      /*  if(n>1){
            cN = (n*(n-1))/2;
        }else{
            cN = 0;
        }

        if(m>1){
            cM = (m*(m-1))/2;
        }else {
            cM = 0;
        }*/
        System.out.println(cM+cN);


    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int cN,cM;
        cN = (n>1)?(n*(n-1))/2:0;
        cM = (m>1)?(m*(m-1))/2:0;
      /*  if(n>1){
            cN = (n*(n-1))/2;
        }else{
            cN = 0;
        }

        if(m>1){
            cM = (m*(m-1))/2;
        }else {
            cM = 0;
        }*/
        System.out.println(cM+cN);


    }
} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int cN,cM;
        cN = (n>1)?(n*(n-1))/2:0;
        cM = (m>1)?(m*(m-1))/2:0;
      /*  if(n>1){
            cN = (n*(n-1))/2;
        }else{
            cN = 0;
        }

        if(m>1){
            cM = (m*(m-1))/2;
        }else {
            cM = 0;
        }*/
        System.out.println(cM+cN);


    }
}
