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

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

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