#include <bits/stdc++.h>
using namespace std;
vector<string> vec_splitter(string s) {
  s += ',';
  vector<string> res;
  while (!s.empty()) {
    res.push_back(s.substr(0, s.find(',')));
    s = s.substr(s.find(',') + 1);
  }
  return res;
}
void debug_out(vector<string> __attribute__((unused)) args,
               __attribute__((unused)) int idx,
               __attribute__((unused)) int LINE_NUM) {
  cerr << endl;
}
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
  if (idx > 0)
    cerr << ", ";
  else
    cerr << "Line(" << LINE_NUM << ") ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, LINE_NUM, T...);
}
template <class K, class V>
ostream& operator<<(ostream& s, const pair<K, V>& p) {
  s << '<' << p.first << ", " << p.second << '>';
  return s;
}
template <class T, class = typename T::value_type,
          class = typename enable_if<!is_same<T, string>::value>::type>
ostream& operator<<(ostream& s, const T& v) {
  s << '[';
  for (auto& x : v) {
    s << x << ", ";
  }
  if (!v.empty()) {
    s << "\b\b";
  }
  s << ']';
  return s;
}
void __prnt() { cerr << endl; }
template <class T, class... Ts>
void __prnt(T&& a, Ts&&... etc) {
  cerr << a << ' ';
  __prnt(etc...);
}
template <typename T>
T gcd(T a, T b) {
  return (b ? __gcd(a, b) : a);
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
template <typename T>
T power(T e, long long n) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = x * p;
    p = p * p;
    n >>= 1;
  }
  return x;
}
template <typename T>
T powerMod(T e, long long n, long long m) {
  T x = 1, p = e % m;
  if (p == 0) return 0;
  while (n) {
    if (n & 1) x = (long long)x * p % m;
    p = (long long)p * p % m;
    n >>= 1;
  }
  return x;
}
template <typename T>
T modInv(T a, T m) {
  return powerMod(a, m - 2, m);
}
const int inf = INT_MAX;
const long long INF = 9e18;
const int mod = 1000000007;
const long double eps = 1e-9;
const int N = 5e6;
int spf[N];
void sieve() {
  spf[1] = 1;
  for (int i = 2; i <= N; i++) {
    spf[i] = i;
  }
  for (int i = 4; i <= N; i += 2) {
    spf[i] = 2;
  }
  for (int i = 3; i * i <= N; i++) {
    if (spf[i] == i) {
      for (int j = i * i; j <= N; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
int prime[1000000 + 1];
void SieveOfEratosthenes(long long n) {
  for (long long int i = 0; i < 1000000 + 1; i++) prime[i] = 1;
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == 1) {
      for (int i = p * p; i <= n; i += p) prime[i] = 0;
    }
  }
  prime[0] = prime[1] = 0;
}
set<int> getFactorization(int x) {
  set<int> ret;
  for (int i = 2; (i * i) <= x; i++) {
    if (x % i == 0) {
      ret.insert(i);
      while (x % i == 0) {
        x /= i;
      }
    }
  }
  if (x > 1) {
    ret.insert(x);
  }
  return ret;
}
vector<int> getFactorization1(int x) {
  vector<int> ret;
  while (x != 1) {
    ret.push_back(spf[x]);
    x = x / spf[x];
  }
  return ret;
}
long long int power(int a, int n, int c) {
  long long int s = 1;
  while (n) {
    if (n % 2 != 0) {
      s = s % c * a % c;
      n--;
    } else {
      a = (a * a) % c;
      n /= 2;
    }
  }
  return s % 10;
}
void GCD_Candidates(long long A, long long B) {
  set<long long> s;
  long long num = (A < B) ? A : B;
  long long GANESH_JI = (A > B) ? A : B;
  for (long long i = 1; i * i <= num; i++) {
    if (num % i == 0) {
      if (GANESH_JI % i == 0) s.insert(i);
      if (GANESH_JI % (num / i) == 0) s.insert(num / i);
    }
  }
}
struct graph {
  long long a;
  long long b;
  long long w;
};
bool component(graph a, graph b) {
  if (a.w < b.w) return true;
  return false;
}
int par[150000];
long long find(long long a) {
  if (par[a] == -1) return a;
  return par[a] = find(par[a]);
}
long long a, b, k;
bool solve1(long long m) {
  long long left = a;
  long long right = a + m - 1;
  while (right <= b) {
    long long number_of_primes = prime[right] - prime[left - 1];
    if (number_of_primes < k) {
      return false;
    }
    right++;
    left++;
  }
  return true;
}
int solve() {
  cin >> a >> b >> k;
  SieveOfEratosthenes(1000000);
  for (long long int i = 1; i <= 1000000; i++) prime[i] += prime[i - 1];
  long long l = 0;
  long long r = 1e18;
  long long ans = -1;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (solve1(mid)) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  if (ans > b - a + 1) return -1;
  return ans;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) {
    cout << solve();
  }
  return 0;
}
