N = int(input())
S = input()
a = list('##.#')
b = list('##..')
c = list('.#.#')
d = list('.#..')
ans = 0
if N == 1:
    print(0)
elif N == 2:
    if S == '#.':
        print(1)
    else:
        print(0)
elif N == 3:
    if S.find('#.') != -1:
        print(1)
    else:
        print(0)
else:
    S = '.' + S
    S = S + '#'
    t = list(S[:4])
    e = 3
    N += 2
    while True:
        if t == a or t == c:
            ans += 1
            t[2] = '#'
        elif t == b:
            ans += 2
            t[1] = '.'
        elif t == d:
            ans += 1
            t[1] = '.'
        e += 1
        if e > N-1:
            break
        t = t[1:] + [S[e]]
    print(ans)
