#include <bits/stdc++.h>
using namespace std;
int a, b, k;
int games_won[3];
void swap(int& a, int& b) {
  int aux = a;
  a = b;
  b = aux;
}
void play(int a, int b);
int main() {
  int games_played = 0;
  scanf("%d %d %d", &k, &a, &b);
  play(a, b);
  printf("%d\n", games_won[1] + games_won[2]);
  return 0;
}
void play(int a, int b) {
  int maxim, minim, crt;
  if (a > b) {
    maxim = a;
    minim = b;
    crt = 1;
  } else {
    minim = a;
    maxim = b;
    crt = 2;
  }
  if (maxim < k) {
    if ((k - 1) * games_won[3 - crt] < maxim ||
        (k - 1) * games_won[crt] < minim) {
      printf("-1\n");
      exit(0);
    }
    return;
  }
  games_won[crt] += maxim / k;
  if (crt == 1)
    play(maxim % k, b);
  else
    play(a, maxim % k);
}
