N = int(input())
S = input()
counter = 0
S_list = []
for chara in S:
    S_list.append(chara)

for i in range(len(S_list)-1):
    if (S_list[i] == '#') and (S_list[i+1] == '.'):
        counter += 1 
        S_list[i+1] = '#'

print(counter)