N = int(input())
S = ['.'] + list(input()) + ['#']
ans = 0

for i in range(1, N):
    if S[i:i+2] == ['#', '.']:
        if S[i-1] == '.':
            S[i] = '.'
            ans += 1
        else:
            S[i] = '#'
            ans += 1
print(ans)