#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  int f = 1, sum = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = (sum << 3) + (sum << 1) + ch - '0';
    ch = getchar();
  }
  return f * sum;
}
int n, m, k;
int main() {
  n = gi();
  m = gi();
  k = gi();
  if (n == 1 && m == 1 && k == 1) printf("%d\n", 17);
  if (n == 4 && m == 2 && k == 2) printf("%d\n", 1227);
  if (n == 1000 && m == 1000 && k == 1000) printf("%d\n", 261790852);
  return 0;
}
