import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    int gu = 0;
    for(int i=1; i<N; i++){
        gu += i;  
      }
    int ki = 0;
    for(int i=1; i<K; i++){
        ki += i;  
    }
 	System.out.println(gu+ki);
      }
} 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 K = sc.nextInt();

    int gu = 0;
    for(int i=1; i<N; i++){
        gu += i;  
      }
    int ki = 0;
    for(int i=1; i<K; i++){
        ki += i;  
    }
 	System.out.println(gu+ki);
      }
} Main public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    int gu = 0;
    for(int i=1; i<N; i++){
        gu += i;  
      }
    int ki = 0;
    for(int i=1; i<K; i++){
        ki += i;  
    }
 	System.out.println(gu+ki);
      } main {
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    int gu = 0;
    for(int i=1; i<N; i++){
        gu += i;  
      }
    int ki = 0;
    for(int i=1; i<K; i++){
        ki += i;  
    }
 	System.out.println(gu+ki);
      } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc int gu = 0; gu 0 for(int i=1; i<N; i++){
        gu += i;  
      } int i=1; int i=1; i 1 i<N i N i++ i++ i {
        gu += i;  
      } {
        gu += i;  
      } gu += i gu i int ki = 0; ki 0 for(int i=1; i<K; i++){
        ki += i;  
    } int i=1; int i=1; i 1 i<K i K i++ i++ i {
        ki += i;  
    } {
        ki += i;  
    } ki += i ki i System.out.println(gu+ki) System.out.println System.out System System.out gu+ki gu ki String[] args args public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    int gu = 0;
    for(int i=1; i<N; i++){
        gu += i;  
      }
    int ki = 0;
    for(int i=1; i<K; i++){
        ki += i;  
    }
 	System.out.println(gu+ki);
      }
} public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    int gu = 0;
    for(int i=1; i<N; i++){
        gu += i;  
      }
    int ki = 0;
    for(int i=1; i<K; i++){
        ki += i;  
    }
 	System.out.println(gu+ki);
      }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    int gu = 0;
    for(int i=1; i<N; i++){
        gu += i;  
      }
    int ki = 0;
    for(int i=1; i<K; i++){
        ki += i;  
    }
 	System.out.println(gu+ki);
      }
}
