#include <iostream>
#include <set>
using namespace std;
class Solution {
public:
int findMinFibonacciNumbers(int k) {
int a = 1, b = 1, c;
set<int> fibs = {1};
while(a + b <= 1e9){
c = a + b;
fibs.insert(c);
a = b, b = c;
}
int res = 0;
while(k){
set<int>::iterator iter = fibs.lower_bound(k);
if(!(iter != fibs.end() && *iter == k)) iter --;
res ++;
k -= *iter;
}
return res;
}
};
int main() {
cout << Solution().findMinFibonacciNumbers(7) << endl;
return 0;
}