N = int(input())
S = input()

li = list(S)
count = 0

for i in range(N-1):
    if '#' == li[i] and '.' == li[i+1]:
        li[i] = '.'
        count += 1
for i in range(N-1):
    if '#' == li[i] and '.' == li[i+1]:
        li[i] = '.'
        count += 1
        
print(count)
