import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int M = sc.nextInt();
        int total = N + M ;
        int count =0;
        int ref = N;
        
        while(ref > 0){
            count += ref;
            ref--;
        }
        count = count - N;
        int ref1= M;
        int c =0;
        while(ref1 > 0){
            c = c + ref1;
            ref1--;
        }
        c = c - M;
        System.out.println(count + c);
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int M = sc.nextInt();
        int total = N + M ;
        int count =0;
        int ref = N;
        
        while(ref > 0){
            count += ref;
            ref--;
        }
        count = count - N;
        int ref1= M;
        int c =0;
        while(ref1 > 0){
            c = c + ref1;
            ref1--;
        }
        c = c - M;
        System.out.println(count + c);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int M = sc.nextInt();
        int total = N + M ;
        int count =0;
        int ref = N;
        
        while(ref > 0){
            count += ref;
            ref--;
        }
        count = count - N;
        int ref1= M;
        int c =0;
        while(ref1 > 0){
            c = c + ref1;
            ref1--;
        }
        c = c - M;
        System.out.println(count + c);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int M = sc.nextInt();
        int total = N + M ;
        int count =0;
        int ref = N;
        
        while(ref > 0){
            count += ref;
            ref--;
        }
        count = count - N;
        int ref1= M;
        int c =0;
        while(ref1 > 0){
            c = c + ref1;
            ref1--;
        }
        c = c - M;
        System.out.println(count + c);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc int total = N + M ; total N + M N M int count =0; count 0 int ref = N; ref N while(ref > 0){
            count += ref;
            ref--;
        } ref > 0 ref 0 {
            count += ref;
            ref--;
        } count += ref count ref ref-- ref count = count - N count count - N count N int ref1= M; ref1 M int c =0; c 0 while(ref1 > 0){
            c = c + ref1;
            ref1--;
        } ref1 > 0 ref1 0 {
            c = c + ref1;
            ref1--;
        } c = c + ref1 c c + ref1 c ref1 ref1-- ref1 c = c - M c c - M c M System.out.println(count + c) System.out.println System.out System System.out count + c count c String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int M = sc.nextInt();
        int total = N + M ;
        int count =0;
        int ref = N;
        
        while(ref > 0){
            count += ref;
            ref--;
        }
        count = count - N;
        int ref1= M;
        int c =0;
        while(ref1 > 0){
            c = c + ref1;
            ref1--;
        }
        c = c - M;
        System.out.println(count + c);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int M = sc.nextInt();
        int total = N + M ;
        int count =0;
        int ref = N;
        
        while(ref > 0){
            count += ref;
            ref--;
        }
        count = count - N;
        int ref1= M;
        int c =0;
        while(ref1 > 0){
            c = c + ref1;
            ref1--;
        }
        c = c - M;
        System.out.println(count + c);
	}
} Main
import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int M = sc.nextInt();
        int total = N + M ;
        int count =0;
        int ref = N;
        
        while(ref > 0){
            count += ref;
            ref--;
        }
        count = count - N;
        int ref1= M;
        int c =0;
        while(ref1 > 0){
            c = c + ref1;
            ref1--;
        }
        c = c - M;
        System.out.println(count + c);
	}
}
