def f_my2(n):
    """
    Try to simplify the previous function f_my
    """
    pre2, pre1 = 0, 1
    if n == 0:
        return 0
    if n == 1:
        return 1
    for i in range(2, n+1):
        pre2, pre1 =pre1,  pre2+pre1 # for current state
    
    return pre1