import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        int sum1=0,sum2=0,sum=0;
        a=a-1;b=b-1;
        sum1=(a*(a+1))/2;
        sum2=(b*(b+1))/2;
        sum=sum1+sum2;
        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        int sum1=0,sum2=0,sum=0;
        a=a-1;b=b-1;
        sum1=(a*(a+1))/2;
        sum2=(b*(b+1))/2;
        sum=sum1+sum2;
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        int sum1=0,sum2=0,sum=0;
        a=a-1;b=b-1;
        sum1=(a*(a+1))/2;
        sum2=(b*(b+1))/2;
        sum=sum1+sum2;
        System.out.println(sum);
    } main {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        int sum1=0,sum2=0,sum=0;
        a=a-1;b=b-1;
        sum1=(a*(a+1))/2;
        sum2=(b*(b+1))/2;
        sum=sum1+sum2;
        System.out.println(sum);
    } Scanner in=new Scanner(System.in); in new Scanner(System.in) int a=in.nextInt(); a in.nextInt() in.nextInt in int b=in.nextInt(); b in.nextInt() in.nextInt in int sum1=0 sum1 0 sum2=0 sum2 0 sum=0; sum 0 a=a-1 a a-1 a 1 b=b-1 b b-1 b 1 sum1=(a*(a+1))/2 sum1 (a*(a+1))/2 (a*(a+1)) a (a+1) a 1 2 sum2=(b*(b+1))/2 sum2 (b*(b+1))/2 (b*(b+1)) b (b+1) b 1 2 sum=sum1+sum2 sum sum1+sum2 sum1 sum2 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        int sum1=0,sum2=0,sum=0;
        a=a-1;b=b-1;
        sum1=(a*(a+1))/2;
        sum2=(b*(b+1))/2;
        sum=sum1+sum2;
        System.out.println(sum);
    }
} public class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        int sum1=0,sum2=0,sum=0;
        a=a-1;b=b-1;
        sum1=(a*(a+1))/2;
        sum2=(b*(b+1))/2;
        sum=sum1+sum2;
        System.out.println(sum);
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        int sum1=0,sum2=0,sum=0;
        a=a-1;b=b-1;
        sum1=(a*(a+1))/2;
        sum2=(b*(b+1))/2;
        sum=sum1+sum2;
        System.out.println(sum);
    }
}