def con2frac(con_list):
    a, b = 1, 0
    for r in reversed(con_list):
        a, b = b + a * r, a
    return a, b

def exp_con(limit):
    exp_list = [1] * limit
    exp_list[0] = 2
    exp_list[2::3] = list(range(2, limit // 3 * 2 + 1, 2))
    return con2frac(exp_list)[0]

print(sum(map(lambda x: int(x), str(exp_con(100)))))