import sys
N = int(sys.stdin.readline().rstrip())
S = list(sys.stdin.readline().rstrip())
ans = 0
for i in range(N - 1):
    if S[i] + S[i + 1] == "#.":
        if 0 <= i - 1 and S[i - 1] == "#":
            S[i + 1] = "#"    
        else:
            S[i] = "."
        ans += 1
print(ans)