#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define pb(x) push_back(x)
#define cls(x, val) memset(x, val, sizeof(x))
#define fi first
#define se second
#define mp(x, y) make_pair(x, y)
#define inc(i, l, r) for(int i=l; i<=r; i++)
const int inf = 0x3f3f3f3f;
const int maxn = 2000+10;
int s, n, m;
struct Node{
int num[3];
int ans;
bool operator < (const Node &b) const {
if(num[0]!=b.num[0]) return num[0]<b.num[0];
else if(num[1]!=b.num[1]) return num[1]<b.num[1];
return num[2]<b.num[2];
}
};
map<Node, bool> mp;
bool check(Node x){
int hal = s/2;
if(x.num[0] == hal && x.num[1] == hal) return true;
if(x.num[0] == hal && x.num[2] == hal) return true;
if(x.num[1] == hal && x.num[2] == hal) return true;
return false;
}
void bfs(){
Node temp;
temp.num[0] = s, temp.num[1] = 0, temp.num[2] = 0;
temp.ans = 0;
queue<Node> q;
q.push(temp);
Node t;
bool has = false;
while(!q.empty()){
temp = q.front();
q.pop();
if(mp[temp]) continue;
mp[temp] = true;
if(check(temp)){
cout<<temp.ans<<endl;
has = true;
break;
}
if(temp.num[0]){
t = temp;
if(temp.num[0]+temp.num[1]<=n){
t.num[1] += t.num[0];
t.num[0] = 0;
if(!mp[t])
t.ans++, q.push(t);
}
else {
int res = n-t.num[1];
t.num[0] -= res;
t.num[1] = n;
if(mp[t] == false)
t.ans++, q.push(t);
}
t = temp;
if(temp.num[0]+temp.num[2]<=m){
t.num[2] += t.num[0];
t.num[0] = 0;
if(!mp[t])
t.ans++, q.push(t);
}
else {
int res = m-t.num[2];
t.num[0] -= res;
t.num[2] = m;
if(!mp[t])
t.ans++, q.push(t);
}
}
if(temp.num[1]){
t = temp;
if(temp.num[1]+temp.num[0]<=s){
t.num[0] += t.num[1];
t.num[1] = 0;
if(!mp[t])
t.ans++, q.push(t);
}
else {
int res = s-t.num[0];
t.num[1] -= res;
t.num[0] = s;
if(!mp[t])
t.ans++, q.push(t);
}
t = temp;
if(temp.num[1]+temp.num[2]<=m){
t.num[2] += t.num[1];
t.num[1] = 0;
if(!mp[t])
t.ans++, q.push(t);
}
else {
int res = m-t.num[2];
t.num[1] -= res;
t.num[2] = m;
if(!mp[t])
t.ans++, q.push(t);
}
}
if(temp.num[2]){
t = temp;
if(temp.num[0]+temp.num[2]<=s){
t.num[0] += t.num[2];
t.num[2] = 0;
if(!mp[t])
t.ans++, q.push(t);
}
else {
int res = s-t.num[0];
t.num[2] -= res;
t.num[0] = s;
if(!mp[t])
t.ans++, q.push(t);
}
t = temp;
if(temp.num[1]+temp.num[2]<=n){
t.num[1] += t.num[2];
t.num[2] = 0;
if(!mp[t])
t.ans++, q.push(t);
}
else {
int res = n-t.num[1];
t.num[2] -= res;
t.num[1] = n;
if(!mp[t])
t.ans++, q.push(t);
}
}
}
if(!has) cout<<"NO"<<endl;
}
int main(){
ios::sync_with_stdio(false);
while(cin>>s>>n>>m){
if(s+m+n == 0) break;
if(s%2) {
cout<<"NO"<<endl;
continue;
}
mp.clear();
bfs();
}
return 0;
}