def fibonacci(n): 
    """Computes the nth fibonacci number, starting at 0.

    :param n: the index of the Fibonacci number to be computed
    :raises: raises ValueError if n is less than 1
    :return: nth fibonacci number
    :rtype: int
    """
    if n<=0: 
        raise ValueError("Input cannot be less than 1") 
    elif n==1: 
        return 0
    elif n==2: 
        return 1
    else: 
        return fibonacci(n-1)+fibonacci(n-2)