import 'dart:io';

void main() {
  List xkd = stdin.readLineSync().split(" ").map((x) => int.parse(x)).toList();
  List list;
  list = [];

  for (int a = 0; a <= xkd[1]; a++) {
    // int ans0 = xkd[0] - xkd[1] * xkd[2] + 2 * a * xkd[2];
    int anss = (2 * a - xkd[1]);
    list.add(anss.abs());
  }
  List ans = list..sort((a, b) => a.compareTo(b));
  print(ans[0] * xkd[2].abs());
}