import std.conv, std.functional, std.range, std.stdio, std.string;
import std.algorithm, std.array, std.bigint, std.bitmanip, std.complex, std.container, std.math, std.mathspecial, std.numeric, std.regex, std.typecons;
import core.bitop;

class EOFException : Throwable { this() { super("EOF"); } }
string[] tokens;
string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; }
int readInt() { return readToken.to!int; }
long readLong() { return readToken.to!long; }
real readReal() { return readToken.to!real; }

bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } }
bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } }

int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; }
int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); }
int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); }


long solve(long X, long Y, long K) {
  const limArea = K + max(X, Y);
  long ans;
  foreach (x; 1 .. X) {
    const limY1 = min((2 * limArea) / x, Y - 1);
    auto g0 = new long[limY1 + 1];
    auto g1 = new long[limY1 + 1];
    foreach (y; 0 .. limY1 + 1) {
      g0[y] = gcd(x, y);
      g1[y] = gcd(X - x, y);
    }
    foreach (y; 1 .. limY1 + 1) {
      if (((X * y) - (g0[y] + g1[y] + X)) / 2 + 1 <= K) {
        ans += 1;
      }
    }
    foreach (d; 1 .. limY1) {
      const g2 = gcd(X, d);
      long lo = 0, hi = limY1 - d + 1;
      for (; lo + 1 < hi; ) {
        const mid = (lo + hi) / 2;
        ((((X * (mid + d) - (X - x) * d) - (g0[mid] + g1[mid + d] + g2)) / 2 + 1 <= K) ? lo : hi) = mid;
      }
      ans += 2 * lo;
    }
  }
  
  debug {
    if (X <= 100 && Y <= 100) {
      long brt;
      foreach (x; 1 .. X) foreach (y0; 1 .. Y) foreach (y1; y0 .. Y) {
        if (((X * y1 - (X - x) * (y1 - y0)) - (gcd(x, y0) + gcd(X - x, y1) + gcd(X, y1 - y0))) / 2 + 1 <= K) {
          brt += (y0 == y1) ? 1 : 2;
        }
      }
      writeln("brt = ", brt, ", ans = ", ans);
      assert(brt == ans);
    }
  }
  
  return ans;
}

void main() {
  try {
    for (; ; ) {
      const W = readInt();
      const H = readInt();
      const K = readInt();
      
      long ans;
      ans += solve(W, H, K);
      ans += solve(H, W, K);
      ans *= 2;
      writeln(ans);
    }
  } catch (EOFException e) {
  }
}
