import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int sum = 0 - N - M;
        for(int i=N;i>0;i--)
        {
            sum = sum + i;
        }
        for(int i=M;i>0;i--)
        {
            sum = sum + i;
        }
        System.out.println(sum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int sum = 0 - N - M;
        for(int i=N;i>0;i--)
        {
            sum = sum + i;
        }
        for(int i=M;i>0;i--)
        {
            sum = sum + i;
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int sum = 0 - N - M;
        for(int i=N;i>0;i--)
        {
            sum = sum + i;
        }
        for(int i=M;i>0;i--)
        {
            sum = sum + i;
        }
        System.out.println(sum);
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int sum = 0 - N - M;
        for(int i=N;i>0;i--)
        {
            sum = sum + i;
        }
        for(int i=M;i>0;i--)
        {
            sum = sum + i;
        }
        System.out.println(sum);
    } 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 sum = 0 - N - M; sum 0 - N - M 0 - N - M 0 N M for(int i=N;i>0;i--)
        {
            sum = sum + i;
        } int i=N; int i=N; i N i>0 i 0 i-- i-- i {
            sum = sum + i;
        } {
            sum = sum + i;
        } sum = sum + i sum sum + i sum i for(int i=M;i>0;i--)
        {
            sum = sum + i;
        } int i=M; int i=M; i M i>0 i 0 i-- i-- i {
            sum = sum + i;
        } {
            sum = sum + i;
        } sum = sum + i sum sum + i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int sum = 0 - N - M;
        for(int i=N;i>0;i--)
        {
            sum = sum + i;
        }
        for(int i=M;i>0;i--)
        {
            sum = sum + i;
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int sum = 0 - N - M;
        for(int i=N;i>0;i--)
        {
            sum = sum + i;
        }
        for(int i=M;i>0;i--)
        {
            sum = sum + i;
        }
        System.out.println(sum);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int sum = 0 - N - M;
        for(int i=N;i>0;i--)
        {
            sum = sum + i;
        }
        for(int i=M;i>0;i--)
        {
            sum = sum + i;
        }
        System.out.println(sum);
    }
}
