#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  for (int x = a, count = 0; x <= b; x++) {
    if (x % c == 0) {
      count++;
    }
  }
  cout << c << endl;
  return 0;
}
