#改行入力
N = int(input())
S = input()

count = 0


for i in range(len(S)):
    if  i != len(S)-1:
        if S[i] == "#" and S[i+1] == ".":
            count = count +1
            if i == 0:
                S = "." + S[i+1:]
            elif i == len(S) - 2:
                S = S[:i+1] + '#'

            elif S[i-1] == "#":
                S = S[:i+1] + '#' + S[i+2:]
            elif S[i-1] == ".":
                S = S[:i] + "." + S[i+1:]

print(count)
