import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int m = Integer.parseInt(scanner.next());
        System.out.println(cmb(n)+cmb(m));
    }
    
    public static int cmb(int a) {
        if (a < 1){
            return 0;
        }
        return a*(a-1)/2;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int m = Integer.parseInt(scanner.next());
        System.out.println(cmb(n)+cmb(m));
    }
    
    public static int cmb(int a) {
        if (a < 1){
            return 0;
        }
        return a*(a-1)/2;
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int m = Integer.parseInt(scanner.next());
        System.out.println(cmb(n)+cmb(m));
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int m = Integer.parseInt(scanner.next());
        System.out.println(cmb(n)+cmb(m));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.next()); n Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int m = Integer.parseInt(scanner.next()); m Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner System.out.println(cmb(n)+cmb(m)) System.out.println System.out System System.out cmb(n)+cmb(m) cmb(n) cmb n cmb(m) cmb m String[] args args public static int cmb(int a) {
        if (a < 1){
            return 0;
        }
        return a*(a-1)/2;
    } cmb {
        if (a < 1){
            return 0;
        }
        return a*(a-1)/2;
    } if (a < 1){
            return 0;
        } a < 1 a 1 {
            return 0;
        } return 0; 0 return a*(a-1)/2; a*(a-1)/2 a*(a-1) a (a-1) a 1 2 int a a public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int m = Integer.parseInt(scanner.next());
        System.out.println(cmb(n)+cmb(m));
    }
    
    public static int cmb(int a) {
        if (a < 1){
            return 0;
        }
        return a*(a-1)/2;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int m = Integer.parseInt(scanner.next());
        System.out.println(cmb(n)+cmb(m));
    }
    
    public static int cmb(int a) {
        if (a < 1){
            return 0;
        }
        return a*(a-1)/2;
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int m = Integer.parseInt(scanner.next());
        System.out.println(cmb(n)+cmb(m));
    }
    
    public static int cmb(int a) {
        if (a < 1){
            return 0;
        }
        return a*(a-1)/2;
    }
}
