N = int(input())
S = list(str(input()))

ans = 0
for i in range(N-1):
    if i != 0 and i != N-2:
        tmp1 = S[i-1]
        tmp2 = S[i]
        tmp3 = S[i+1]
        tmp4 = S[i+2]
        if tmp2 == '#' and tmp3 == '.':
            if tmp1 == '#' and tmp4 == '#':
                S[i+1] = '#'
                ans += 1
            if tmp1 == '#' and tmp4 == '.':
                S[i+1] = '#'
                ans += 1
            if tmp1 == '.' and tmp4 == '#':
                S[i] = '.'
                ans += 1
            if tmp1 == '.' and tmp4 == '.':
                S[i] = '.'
                ans += 1
    if i == 0:
        tmp2 = S[i]
        tmp3 = S[i+1]
        if tmp2 == '#' and tmp3 == '.':
            S[i] = '.'
            ans += 1
    if i == N-2:
        tmp2 = S[i]
        tmp3 = S[i+1]
        if tmp2 == '#' and tmp3 == '.':
            S[i+1] = '#'
            ans += 1
print(ans)