import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
int a=1,b=2;
int count=0;
int c=sc.nextInt();
int d=sc.nextInt();
for(int i=1;i<=c;i++){
    count+=(i-1);
}
for(int i=1;i<=d;i++){
    count+=(i-1);
}
System.out.println(count);
}
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
int a=1,b=2;
int count=0;
int c=sc.nextInt();
int d=sc.nextInt();
for(int i=1;i<=c;i++){
    count+=(i-1);
}
for(int i=1;i<=d;i++){
    count+=(i-1);
}
System.out.println(count);
}
} Main public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
int a=1,b=2;
int count=0;
int c=sc.nextInt();
int d=sc.nextInt();
for(int i=1;i<=c;i++){
    count+=(i-1);
}
for(int i=1;i<=d;i++){
    count+=(i-1);
}
System.out.println(count);
} main {
Scanner sc=new Scanner(System.in);
int a=1,b=2;
int count=0;
int c=sc.nextInt();
int d=sc.nextInt();
for(int i=1;i<=c;i++){
    count+=(i-1);
}
for(int i=1;i<=d;i++){
    count+=(i-1);
}
System.out.println(count);
} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int a=1 a 1 b=2; b 2 int count=0; count 0 int c=sc.nextInt(); c sc.nextInt() sc.nextInt sc int d=sc.nextInt(); d sc.nextInt() sc.nextInt sc for(int i=1;i<=c;i++){
    count+=(i-1);
} int i=1; int i=1; i 1 i<=c i c i++ i++ i {
    count+=(i-1);
} {
    count+=(i-1);
} count+=(i-1) count (i-1) i 1 for(int i=1;i<=d;i++){
    count+=(i-1);
} int i=1; int i=1; i 1 i<=d i d i++ i++ i {
    count+=(i-1);
} {
    count+=(i-1);
} count+=(i-1) count (i-1) i 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
int a=1,b=2;
int count=0;
int c=sc.nextInt();
int d=sc.nextInt();
for(int i=1;i<=c;i++){
    count+=(i-1);
}
for(int i=1;i<=d;i++){
    count+=(i-1);
}
System.out.println(count);
}
} public class Main {
    public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
int a=1,b=2;
int count=0;
int c=sc.nextInt();
int d=sc.nextInt();
for(int i=1;i<=c;i++){
    count+=(i-1);
}
for(int i=1;i<=d;i++){
    count+=(i-1);
}
System.out.println(count);
}
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
int a=1,b=2;
int count=0;
int c=sc.nextInt();
int d=sc.nextInt();
for(int i=1;i<=c;i++){
    count+=(i-1);
}
for(int i=1;i<=d;i++){
    count+=(i-1);
}
System.out.println(count);
}
}