
import java.util.*;
import java.io.*;

import static java.lang.Character.isUpperCase;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();

        int x = N+M;
        int z = N*M;

        int a = (x*(x-1))/2 - z;
        System.out.println(a);



 }

    }


    




 import java.util.*; util.* java import java.io.*; io.* java import static java.lang.Character.isUpperCase; import static java.lang.Character.isUpperCase; import static java.lang.Character.isUpperCase; public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();

        int x = N+M;
        int z = N*M;

        int a = (x*(x-1))/2 - z;
        System.out.println(a);



 }

    } Main public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();

        int x = N+M;
        int z = N*M;

        int a = (x*(x-1))/2 - z;
        System.out.println(a);



 } main {

        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();

        int x = N+M;
        int z = N*M;

        int a = (x*(x-1))/2 - z;
        System.out.println(a);



 } Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int M = in.nextInt(); M in.nextInt() in.nextInt in int x = N+M; x N+M N M int z = N*M; z N*M N M int a = (x*(x-1))/2 - z; a (x*(x-1))/2 - z (x*(x-1))/2 (x*(x-1)) x (x-1) x 1 2 z System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();

        int x = N+M;
        int z = N*M;

        int a = (x*(x-1))/2 - z;
        System.out.println(a);



 }

    } public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();

        int x = N+M;
        int z = N*M;

        int a = (x*(x-1))/2 - z;
        System.out.println(a);



 }

    } Main

import java.util.*;
import java.io.*;

import static java.lang.Character.isUpperCase;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();

        int x = N+M;
        int z = N*M;

        int a = (x*(x-1))/2 - z;
        System.out.println(a);



 }

    }


    





