N = int(input())
S = list(input())
 
res = 0
for i in range(len(S)-1):
    if S[i] == '#' and S[i+1] == '.':
        if i+2 <= len(S)-1:
            if S[i+2] == '.':
                if i > 0:
                    if S[i-1] != '#':
                        S[i] = '.'
                        res += 1
                        continue
                else:
                    S[i] = '.'
                    res += 1
                    continue

        res += 1
        S[i+1] = '#'

print(res)