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