import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.run();
    }
    
    // 変数一覧
    int n;
    int m;
    int res;

    public void run() {
        // 入力情報取得
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();
        sc.close();

        // 解答処理
        solve();
    }
    
    private void solve() {
        res += (n * (n - 1)) / 2;
        res += (m * (m - 1)) / 2;
        System.out.println(res);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.run();
    }
    
    // 変数一覧
    int n;
    int m;
    int res;

    public void run() {
        // 入力情報取得
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();
        sc.close();

        // 解答処理
        solve();
    }
    
    private void solve() {
        res += (n * (n - 1)) / 2;
        res += (m * (m - 1)) / 2;
        System.out.println(res);
    }
} Main // 変数一覧
    int n; n int m; m int res; res public static void main(String[] args) {
        Main main = new Main();
        main.run();
    } main {
        Main main = new Main();
        main.run();
    } Main main = new Main(); main new Main() main.run() main.run main String[] args args public void run() {
        // 入力情報取得
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();
        sc.close();

        // 解答処理
        solve();
    } run {
        // 入力情報取得
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();
        sc.close();

        // 解答処理
        solve();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc m = sc.nextInt() m sc.nextInt() sc.nextInt sc sc.close() sc.close sc solve() solve private void solve() {
        res += (n * (n - 1)) / 2;
        res += (m * (m - 1)) / 2;
        System.out.println(res);
    } solve {
        res += (n * (n - 1)) / 2;
        res += (m * (m - 1)) / 2;
        System.out.println(res);
    } res += (n * (n - 1)) / 2 res (n * (n - 1)) / 2 (n * (n - 1)) n (n - 1) n 1 2 res += (m * (m - 1)) / 2 res (m * (m - 1)) / 2 (m * (m - 1)) m (m - 1) m 1 2 System.out.println(res) System.out.println System.out System System.out res public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.run();
    }
    
    // 変数一覧
    int n;
    int m;
    int res;

    public void run() {
        // 入力情報取得
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();
        sc.close();

        // 解答処理
        solve();
    }
    
    private void solve() {
        res += (n * (n - 1)) / 2;
        res += (m * (m - 1)) / 2;
        System.out.println(res);
    }
} public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.run();
    }
    
    // 変数一覧
    int n;
    int m;
    int res;

    public void run() {
        // 入力情報取得
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();
        sc.close();

        // 解答処理
        solve();
    }
    
    private void solve() {
        res += (n * (n - 1)) / 2;
        res += (m * (m - 1)) / 2;
        System.out.println(res);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.run();
    }
    
    // 変数一覧
    int n;
    int m;
    int res;

    public void run() {
        // 入力情報取得
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();
        sc.close();

        // 解答処理
        solve();
    }
    
    private void solve() {
        res += (n * (n - 1)) / 2;
        res += (m * (m - 1)) / 2;
        System.out.println(res);
    }
}