int nests (int a, int b, int c)
{
	int d = 0;
	int ii;
	if ((a==0 || b==0) && c==0){
		d=0;
	}else{
		for (ii = 1; ii<a && d<3; ii++){
			if(d == 0){
				d = a + b;
			}else if(d == 1){
				d = a + b + c;
			}else{
				d = b + c;
			}
		}
	}
	return d;
}
