import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		int N = Integer.parseInt(st.nextToken());
		int M = Integer.parseInt(st.nextToken());
		
		int cnt = 0;
		for(int i=1; i<N; i++) {
			for(int j=i+1; j<=N; j++)
				cnt++;
		}
		
		if(M > 1) {
			for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			}
		} else {
			cnt += 0;
		}
		
		System.out.println(cnt);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		int N = Integer.parseInt(st.nextToken());
		int M = Integer.parseInt(st.nextToken());
		
		int cnt = 0;
		for(int i=1; i<N; i++) {
			for(int j=i+1; j<=N; j++)
				cnt++;
		}
		
		if(M > 1) {
			for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			}
		} else {
			cnt += 0;
		}
		
		System.out.println(cnt);
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		int N = Integer.parseInt(st.nextToken());
		int M = Integer.parseInt(st.nextToken());
		
		int cnt = 0;
		for(int i=1; i<N; i++) {
			for(int j=i+1; j<=N; j++)
				cnt++;
		}
		
		if(M > 1) {
			for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			}
		} else {
			cnt += 0;
		}
		
		System.out.println(cnt);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		int N = Integer.parseInt(st.nextToken());
		int M = Integer.parseInt(st.nextToken());
		
		int cnt = 0;
		for(int i=1; i<N; i++) {
			for(int j=i+1; j<=N; j++)
				cnt++;
		}
		
		if(M > 1) {
			for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			}
		} else {
			cnt += 0;
		}
		
		System.out.println(cnt);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) int N = Integer.parseInt(st.nextToken()); N Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int M = Integer.parseInt(st.nextToken()); M Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int cnt = 0; cnt 0 for(int i=1; i<N; i++) {
			for(int j=i+1; j<=N; j++)
				cnt++;
		} int i=1; int i=1; i 1 i<N i N i++ i++ i {
			for(int j=i+1; j<=N; j++)
				cnt++;
		} {
			for(int j=i+1; j<=N; j++)
				cnt++;
		} for(int j=i+1; j<=N; j++)
				cnt++; int j=i+1; int j=i+1; j i+1 i 1 j<=N j N j++ j++ j cnt++; cnt++ cnt if(M > 1) {
			for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			}
		} else {
			cnt += 0;
		} M > 1 M 1 {
			for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			}
		} for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			} int i=1; int i=1; i 1 i<M i M i++ i++ i {
				for(int j=i+1; j<=M; j++)
					cnt++;
			} {
				for(int j=i+1; j<=M; j++)
					cnt++;
			} for(int j=i+1; j<=M; j++)
					cnt++; int j=i+1; int j=i+1; j i+1 i 1 j<=M j M j++ j++ j cnt++; cnt++ cnt {
			cnt += 0;
		} cnt += 0 cnt 0 System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		int N = Integer.parseInt(st.nextToken());
		int M = Integer.parseInt(st.nextToken());
		
		int cnt = 0;
		for(int i=1; i<N; i++) {
			for(int j=i+1; j<=N; j++)
				cnt++;
		}
		
		if(M > 1) {
			for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			}
		} else {
			cnt += 0;
		}
		
		System.out.println(cnt);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		int N = Integer.parseInt(st.nextToken());
		int M = Integer.parseInt(st.nextToken());
		
		int cnt = 0;
		for(int i=1; i<N; i++) {
			for(int j=i+1; j<=N; j++)
				cnt++;
		}
		
		if(M > 1) {
			for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			}
		} else {
			cnt += 0;
		}
		
		System.out.println(cnt);
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		int N = Integer.parseInt(st.nextToken());
		int M = Integer.parseInt(st.nextToken());
		
		int cnt = 0;
		for(int i=1; i<N; i++) {
			for(int j=i+1; j<=N; j++)
				cnt++;
		}
		
		if(M > 1) {
			for(int i=1; i<M; i++) {
				for(int j=i+1; j<=M; j++)
					cnt++;
			}
		} else {
			cnt += 0;
		}
		
		System.out.println(cnt);
	}

}