import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long countArray(long n, long k, long x) { long count=((n-3)*(k-1))+(k-2); return count; } public static void main(String[] args) { Scanner in = new Scanner(System.in); long n = in.nextInt(); long k = in.nextInt(); long x = in.nextInt(); long answer = countArray(n, k, x); System.out.println(answer); in.close(); } }