def fibonacci(n: int) -> int:
    """Iterative implementation of Fibonacci algorithm.
    fibonacci(0) = 0
    fibonacci(1) = 1

    :param n: positive integer
    """
    first, sec = 0, 1
    if n == 0:
        return first
    elif n == 1:
        return sec
    else:
        for i in range(2, n):
            temp = first
            first, sec = sec, temp + sec
        return sec