import java.io.BufferedInputStream;
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
    public static long combination(int n,int k){
        if(k==0)
            return 1;
        else
            return combination(n,k-1)*(n-k+1)/k;

    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedInputStream(System.in));
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=0;
        c+=Main.combination(a,2);
        c+=Main.combination(b,2);
        System.out.println(c);

    }
} import java.io.BufferedInputStream; BufferedInputStream java.io import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main {
    public static long combination(int n,int k){
        if(k==0)
            return 1;
        else
            return combination(n,k-1)*(n-k+1)/k;

    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedInputStream(System.in));
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=0;
        c+=Main.combination(a,2);
        c+=Main.combination(b,2);
        System.out.println(c);

    }
} Main public static long combination(int n,int k){
        if(k==0)
            return 1;
        else
            return combination(n,k-1)*(n-k+1)/k;

    } combination {
        if(k==0)
            return 1;
        else
            return combination(n,k-1)*(n-k+1)/k;

    } if(k==0)
            return 1;
        else
            return combination(n,k-1)*(n-k+1)/k; k==0 k 0 return 1; 1 return combination(n,k-1)*(n-k+1)/k; combination(n,k-1)*(n-k+1)/k combination(n,k-1)*(n-k+1) combination(n,k-1) combination n k-1 k 1 (n-k+1) n-k n k 1 k int n n int k k public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedInputStream(System.in));
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=0;
        c+=Main.combination(a,2);
        c+=Main.combination(b,2);
        System.out.println(c);

    } main {
        Scanner sc = new Scanner(new BufferedInputStream(System.in));
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=0;
        c+=Main.combination(a,2);
        c+=Main.combination(b,2);
        System.out.println(c);

    } Scanner sc = new Scanner(new BufferedInputStream(System.in)); sc new Scanner(new BufferedInputStream(System.in)) int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int b=sc.nextInt(); b sc.nextInt() sc.nextInt sc int c=0; c 0 c+=Main.combination(a,2) c Main.combination(a,2) Main.combination Main a 2 c+=Main.combination(b,2) c Main.combination(b,2) Main.combination Main b 2 System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main {
    public static long combination(int n,int k){
        if(k==0)
            return 1;
        else
            return combination(n,k-1)*(n-k+1)/k;

    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedInputStream(System.in));
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=0;
        c+=Main.combination(a,2);
        c+=Main.combination(b,2);
        System.out.println(c);

    }
} public class Main {
    public static long combination(int n,int k){
        if(k==0)
            return 1;
        else
            return combination(n,k-1)*(n-k+1)/k;

    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedInputStream(System.in));
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=0;
        c+=Main.combination(a,2);
        c+=Main.combination(b,2);
        System.out.println(c);

    }
} Main
import java.io.BufferedInputStream;
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
    public static long combination(int n,int k){
        if(k==0)
            return 1;
        else
            return combination(n,k-1)*(n-k+1)/k;

    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedInputStream(System.in));
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=0;
        c+=Main.combination(a,2);
        c+=Main.combination(b,2);
        System.out.println(c);

    }
}