#sum of fibnocci sequence in a given range using for loop
def fibnocci_sum(n):
    a=0
    b=1
    s=a+b
    for i in range(2,n):
        c=a+b
        s+=c
        a=b
        b=c
    return s
n=int(input())
print(fibnocci_sum(n))


#sum of fibnocci sequence in a given range using while loop
def fibnocci_sum(n):
    a=0
    b=1
    s=a+b
    i=2
    while i<n:
        s+=a+b
        a,b=b,a+b
        i+=1
    return s
n=int(input())
print(fibnocci_sum(n))
        

d6f44df6cd7cf8adc02bb50f92e03b57b84f3ed9
<mask token>


def fibnocci_sum(n):
    a = 0
    b = 1
    s = a + b
    i = 2
    while i < n:
        s += a + b
        a, b = b, a + b
        i += 1
    return s


<mask token>

def fibnocci_sum(n):
    a = 0
    b = 1
    s = a + b
    for i in range(2, n):
        c = a + b
        s += c
        a = b
        b = c
    return s


<mask token>


def fibnocci_sum(n):
    a = 0
    b = 1
    s = a + b
    i = 2
    while i < n:
        s += a + b
        a, b = b, a + b
        i += 1
    return s


<mask token>

def fibnocci_sum(n):
    a = 0
    b = 1
    s = a + b
    for i in range(2, n):
        c = a + b
        s += c
        a = b
        b = c
    return s


<mask token>
print(fibnocci_sum(n))


def fibnocci_sum(n):
    a = 0
    b = 1
    s = a + b
    i = 2
    while i < n:
        s += a + b
        a, b = b, a + b
        i += 1
    return s


<mask token>
print(fibnocci_sum(n))

def fibnocci_sum(n):
    a = 0
    b = 1
    s = a + b
    for i in range(2, n):
        c = a + b
        s += c
        a = b
        b = c
    return s


n = int(input())
print(fibnocci_sum(n))


def fibnocci_sum(n):
    a = 0
    b = 1
    s = a + b
    i = 2
    while i < n:
        s += a + b
        a, b = b, a + b
        i += 1
    return s


n = int(input())
print(fibnocci_sum(n))

#sum of fibnocci sequence in a given range using for loop
def fibnocci_sum(n):
    a=0
    b=1
    s=a+b
    for i in range(2,n):
        c=a+b
        s+=c
        a=b
        b=c
    return s
n=int(input())
print(fibnocci_sum(n))


#sum of fibnocci sequence in a given range using while loop
def fibnocci_sum(n):
    a=0
    b=1
    s=a+b
    i=2
    while i<n:
        s+=a+b
        a,b=b,a+b
        i+=1
    return s
n=int(input())
print(fibnocci_sum(n))
        
