/*
数学,模拟n进制乘法
*/
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
int s, a, b;
int main() {
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
while(scanf("%d%d%d", &s, &a, &b) == 3) {
int c = 0, k = a, sum = 0;
int cnt = 0;
while(c!=0 || k!=a || cnt==0) {
sum = k*b + c;
c = sum / s;
k = sum % s;
cnt++;
}
printf("%d\n", cnt);
}
return 0;
}