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