N = int(input())
S = input()
count = 0
for i in range(0, N-1):
    if S[i] == "#" and S[i+1] == ".":
        if i == 0:
            S = "." + S[i+1:]
            count += 1
        elif S[i-1] == ".":
            S = S[:i] + "." + S[i+1:]
            count += 1
        elif i == N-2:
            count += 1
        else:
            S = S[i+1] + "#" + S[i+2:]
            count += 1

print(count)
