#!/bin/python import sys from itertools import * def countArray(n, k, x): # Return the number of ways to fill in the array. tot = (n-1) * (n-3) tot *= (n-3) return tot if __name__ == "__main__": n, k, x = raw_input().strip().split(' ') n, k, x = [int(n), int(k), int(x)] answer = countArray(n, k, x) print answer