N = int(input())
S = list(input())
count = 0;
for i in range(N-1):
    if S[i] == "#" and S[i+1] == ".":
        if S[i-1] == "." and i >= 1:
            S[i] = "."
        else:
            S[i+1] = "#"
        count += 1
print(count)