#include <stdio.h>                                                                                                                                         
                                                                                                                                                           
int main(void)                                                                                                                                             
{                                                                                                                                                          
        long long n, i, a, b, ans = 1;                                                                                                                     
                                                                                                                                                           
        scanf("%lld", &n);                                                                                                                                 
                                                                                                                                                           
        for (i = 0; i <= n; i++) {                                                                                                                         
                if (i == 0) {                                                                                                                              
                        a = 2;                                                                                                                             
                } else if (i == 1) {                                                                                                                       
                        b = 1;                                                                                                                             
                } else {                                                                                                                                   
                        ans = (a + b);                                                                                                                     
                        a = b;                                                                                                                             
                        b = ans;                                                                                                                           
                }                                                                                                                                          
        }                                                                                                                                                  
        printf("%lld\n", ans);                                                                                                                             
        return 0;                                                                                                                                          
}

Measured memory_bytes: 128