import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);

    int n = sn.nextInt();
    int m = sn.nextInt();
    
    int cnt = 0;
    
    if (n > 1) {
      for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      }
    }
    
    if (m > 1) {
      for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      }
    }
    
    System.out.print(cnt);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);

    int n = sn.nextInt();
    int m = sn.nextInt();
    
    int cnt = 0;
    
    if (n > 1) {
      for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      }
    }
    
    if (m > 1) {
      for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      }
    }
    
    System.out.print(cnt);
  }
} Main public static void main(String[] args){
    Scanner sn = new Scanner(System.in);

    int n = sn.nextInt();
    int m = sn.nextInt();
    
    int cnt = 0;
    
    if (n > 1) {
      for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      }
    }
    
    if (m > 1) {
      for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      }
    }
    
    System.out.print(cnt);
  } main {
    Scanner sn = new Scanner(System.in);

    int n = sn.nextInt();
    int m = sn.nextInt();
    
    int cnt = 0;
    
    if (n > 1) {
      for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      }
    }
    
    if (m > 1) {
      for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      }
    }
    
    System.out.print(cnt);
  } Scanner sn = new Scanner(System.in); sn new Scanner(System.in) int n = sn.nextInt(); n sn.nextInt() sn.nextInt sn int m = sn.nextInt(); m sn.nextInt() sn.nextInt sn int cnt = 0; cnt 0 if (n > 1) {
      for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      }
    } n > 1 n 1 {
      for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      }
    } for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      } int i = 1; int i = 1; i 1 i < n i n i ++ i ++ i {
        cnt = cnt + (n - i);
      } {
        cnt = cnt + (n - i);
      } cnt = cnt + (n - i) cnt cnt + (n - i) cnt (n - i) n i if (m > 1) {
      for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      }
    } m > 1 m 1 {
      for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      }
    } for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      } int i = 1; int i = 1; i 1 i < m i m i ++ i ++ i {
        cnt = cnt + (m - i);
      } {
        cnt = cnt + (m - i);
      } cnt = cnt + (m - i) cnt cnt + (m - i) cnt (m - i) m i System.out.print(cnt) System.out.print System.out System System.out cnt String[] args args public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);

    int n = sn.nextInt();
    int m = sn.nextInt();
    
    int cnt = 0;
    
    if (n > 1) {
      for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      }
    }
    
    if (m > 1) {
      for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      }
    }
    
    System.out.print(cnt);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);

    int n = sn.nextInt();
    int m = sn.nextInt();
    
    int cnt = 0;
    
    if (n > 1) {
      for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      }
    }
    
    if (m > 1) {
      for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      }
    }
    
    System.out.print(cnt);
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);

    int n = sn.nextInt();
    int m = sn.nextInt();
    
    int cnt = 0;
    
    if (n > 1) {
      for (int i = 1; i < n; i ++) {
        cnt = cnt + (n - i);
      }
    }
    
    if (m > 1) {
      for (int i = 1; i < m; i ++) {
        cnt = cnt + (m - i);
      }
    }
    
    System.out.print(cnt);
  }
}