import java.util.*;
public class Main  {
   public static void main(String[] args) throws java.lang.Exception  {
      Scanner sc = new Scanner(System.in);
      
      int m = sc.nextInt();
      int n = sc.nextInt();
      
      if (m > 0 && n > 0) {
     
        int mm = m * (m - 1) / 2 ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);
      
      } else if (m == 0 && n > 0) {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } else if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      }
   }        
} import java.util.*; util.* java public class Main  {
   public static void main(String[] args) throws java.lang.Exception  {
      Scanner sc = new Scanner(System.in);
      
      int m = sc.nextInt();
      int n = sc.nextInt();
      
      if (m > 0 && n > 0) {
     
        int mm = m * (m - 1) / 2 ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);
      
      } else if (m == 0 && n > 0) {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } else if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      }
   }        
} Main public static void main(String[] args) throws java.lang.Exception  {
      Scanner sc = new Scanner(System.in);
      
      int m = sc.nextInt();
      int n = sc.nextInt();
      
      if (m > 0 && n > 0) {
     
        int mm = m * (m - 1) / 2 ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);
      
      } else if (m == 0 && n > 0) {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } else if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      }
   } main {
      Scanner sc = new Scanner(System.in);
      
      int m = sc.nextInt();
      int n = sc.nextInt();
      
      if (m > 0 && n > 0) {
     
        int mm = m * (m - 1) / 2 ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);
      
      } else if (m == 0 && n > 0) {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } else if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      }
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc if (m > 0 && n > 0) {
     
        int mm = m * (m - 1) / 2 ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);
      
      } else if (m == 0 && n > 0) {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } else if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      } m > 0 && n > 0 m > 0 m 0 n > 0 n 0 {
     
        int mm = m * (m - 1) / 2 ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);
      
      } int mm = m * (m - 1) / 2 ; mm m * (m - 1) / 2 m * (m - 1) m (m - 1) m 1 2 int nn = n * (n - 1) / 2 ; nn n * (n - 1) / 2 n * (n - 1) n (n - 1) n 1 2 System.out.println(mm + nn) System.out.println System.out System System.out mm + nn mm nn if (m == 0 && n > 0) {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } else if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      } m == 0 && n > 0 m == 0 m 0 n > 0 n 0 {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } int mm = m ; mm m int nn = n * (n - 1) / 2 ; nn n * (n - 1) / 2 n * (n - 1) n (n - 1) n 1 2 System.out.println(mm + nn) System.out.println System.out System System.out mm + nn mm nn if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      } m > 0 && n == 0 m > 0 m 0 n == 0 n 0 {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } int mm = m * (m - 1) / 2 ; mm m * (m - 1) / 2 m * (m - 1) m (m - 1) m 1 2 int nn = n ; nn n System.out.println(mm + nn) System.out.println System.out System System.out mm + nn mm nn {

        System.out.println(m + n);
      } System.out.println(m + n) System.out.println System.out System System.out m + n m n String[] args args public class Main  {
   public static void main(String[] args) throws java.lang.Exception  {
      Scanner sc = new Scanner(System.in);
      
      int m = sc.nextInt();
      int n = sc.nextInt();
      
      if (m > 0 && n > 0) {
     
        int mm = m * (m - 1) / 2 ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);
      
      } else if (m == 0 && n > 0) {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } else if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      }
   }        
} public class Main  {
   public static void main(String[] args) throws java.lang.Exception  {
      Scanner sc = new Scanner(System.in);
      
      int m = sc.nextInt();
      int n = sc.nextInt();
      
      if (m > 0 && n > 0) {
     
        int mm = m * (m - 1) / 2 ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);
      
      } else if (m == 0 && n > 0) {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } else if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      }
   }        
} Main
import java.util.*;
public class Main  {
   public static void main(String[] args) throws java.lang.Exception  {
      Scanner sc = new Scanner(System.in);
      
      int m = sc.nextInt();
      int n = sc.nextInt();
      
      if (m > 0 && n > 0) {
     
        int mm = m * (m - 1) / 2 ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);
      
      } else if (m == 0 && n > 0) {
     	int mm = m ;
        int nn = n * (n - 1) / 2 ;

        System.out.println(mm + nn);	
      } else if (m > 0 && n == 0) {
        int mm = m * (m - 1) / 2 ;
        int nn = n ;

        System.out.println(mm + nn);
      } else {

        System.out.println(m + n);
      }
   }        
}
