n = int(input())
s = input()

white = "."
black = "#"

s_list = list(s)
count = 0
for i in range(len(s)-1):
    if s_list[i] == black and s_list[i+1] == white:
        s_list[i+1] = black
        count +=1
print(count)