#include <cstdio>
int main(){
int n, m;
int x = 0, y = 0, d;
scanf("%d%d%d", &n, &m, &d);
for (int i=1; i<=n; i++) x += d;
for (int i=1; i<=m; i++) y += d;
printf("%d\n", x - y);
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KCmludCBtYWluKCl7CglpbnQgbiwgbTsKCWludCB4ID0gMCwgeSA9IDAsIGQ7CgkKCXNjYW5mKCIlZCVkJWQiLCAmbiwgJm0sICZkKTsKCQoJZm9yIChpbnQgaT0xOyBpPD1uOyBpKyspIHggKz0gZDsKCWZvciAoaW50IGk9MTsgaTw9bTsgaSsrKSB5ICs9IGQ7CgkKCXByaW50ZigiJWRcbiIsIHggLSB5KTsKCXJldHVybiAwOwp9