class Solution {
public int fib(int N) {
int ans=0;
if(N==0){
ans=0;
}
else if(N==1){
ans=1;
}
else{
int f0=0;
int f1=1;
N=N-1;
while(N!=0){
ans=f0+f1;
f0=f1;
f1=ans;
N--;
}
}
return ans;
}
}