def fibi(n: int) -> int:
    """Fibonacci numbers saving just two previous values

    >>> fibi(20)
    6765
    >>> fibi(1)
    1
    >>> fibi(2)
    1
    >>> fibi(3)
    2
    """
    if n == 0:
        return 0
    if n == 1:
        return 1
    f_n2, f_n1 = 1, 1
    for _ in range(3, n+1):
        f_n2, f_n1 = f_n1, f_n2+f_n1
    return f_n1