import java.util.*;

public class Main {
    public static void main(String [] args)
    {
        long even, odd;


        Scanner sc = new Scanner(System.in);
        even = sc.nextLong();
        odd = sc.nextLong();

        long evenTot = (even*(even-1))/2;
        long oddTot = (odd*(odd-1))/2;
        System.out.print(evenTot+oddTot);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String [] args)
    {
        long even, odd;


        Scanner sc = new Scanner(System.in);
        even = sc.nextLong();
        odd = sc.nextLong();

        long evenTot = (even*(even-1))/2;
        long oddTot = (odd*(odd-1))/2;
        System.out.print(evenTot+oddTot);
    }
} Main public static void main(String [] args)
    {
        long even, odd;


        Scanner sc = new Scanner(System.in);
        even = sc.nextLong();
        odd = sc.nextLong();

        long evenTot = (even*(even-1))/2;
        long oddTot = (odd*(odd-1))/2;
        System.out.print(evenTot+oddTot);
    } main {
        long even, odd;


        Scanner sc = new Scanner(System.in);
        even = sc.nextLong();
        odd = sc.nextLong();

        long evenTot = (even*(even-1))/2;
        long oddTot = (odd*(odd-1))/2;
        System.out.print(evenTot+oddTot);
    } long even even odd; odd Scanner sc = new Scanner(System.in); sc new Scanner(System.in) even = sc.nextLong() even sc.nextLong() sc.nextLong sc odd = sc.nextLong() odd sc.nextLong() sc.nextLong sc long evenTot = (even*(even-1))/2; evenTot (even*(even-1))/2 (even*(even-1)) even (even-1) even 1 2 long oddTot = (odd*(odd-1))/2; oddTot (odd*(odd-1))/2 (odd*(odd-1)) odd (odd-1) odd 1 2 System.out.print(evenTot+oddTot) System.out.print System.out System System.out evenTot+oddTot evenTot oddTot String [] args args public class Main {
    public static void main(String [] args)
    {
        long even, odd;


        Scanner sc = new Scanner(System.in);
        even = sc.nextLong();
        odd = sc.nextLong();

        long evenTot = (even*(even-1))/2;
        long oddTot = (odd*(odd-1))/2;
        System.out.print(evenTot+oddTot);
    }
} public class Main {
    public static void main(String [] args)
    {
        long even, odd;


        Scanner sc = new Scanner(System.in);
        even = sc.nextLong();
        odd = sc.nextLong();

        long evenTot = (even*(even-1))/2;
        long oddTot = (odd*(odd-1))/2;
        System.out.print(evenTot+oddTot);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String [] args)
    {
        long even, odd;


        Scanner sc = new Scanner(System.in);
        even = sc.nextLong();
        odd = sc.nextLong();

        long evenTot = (even*(even-1))/2;
        long oddTot = (odd*(odd-1))/2;
        System.out.print(evenTot+oddTot);
    }
}
