n = int(input())
s = list(str(input()))
ans = 0
for i in reversed(range(1, n)):
    if i != n-1:
        if s[i] == '.' and s[i-1] == '#':
            if s[i+1] != '.':
                s[i] = '#'
            else:
                s[i-1] = '.'
            ans += 1
    else:
        if s[i] == '.' and s[i-1] == '#':
            s[i] = '#'
            ans += 1
print(ans)
