#include <bits/stdc++.h>
using namespace std;
int main() {
  long long k, ans;
  double a, b;
  cin >> k >> a >> b;
  a /= k;
  b /= k;
  if (a == 0) {
    if (ceil(b) != floor(b))
      ans = -1;
    else
      ans = floor(b);
  } else if (b == 0) {
    if (ceil(a) != floor(a))
      ans = -1;
    else
      ans = floor(a);
  } else if (a < 1 && b < 1)
    ans = -1;
  else if (a < 1 && (floor(b) != ceil(b)))
    ans = -1;
  else if (b < 1 && (floor(a) != ceil(a)))
    ans = -1;
  else {
    ans = floor(a) + floor(b);
  }
  cout << ans;
  return 0;
}
