function fib(n){
let tot = 0
const arr = []
arr[0] = 1
arr[1] = 1
for(let i=0;i<n;i++){
if(i == 0 || i == 1){
tot += arr[i]
}else{
let t = arr[i-1] + arr[i-2]
tot += t
arr[i] = t
}
}
return tot
}