n = int(input())
s = input()
a = 0
f = 0
for i in range(n-1):
    if s[i] == '#' and s[i + 1] =='.':
        a += 1
        f = 1
    if s[i] == '.' and s[i + 1] == '.' and f == 1:
        a += 1
    if s[i] == '.' and s[i + 1] == '#':
        f = 0
print(a)