N = int(input())
S = list(str(input()))
cnt = 0
for i in range(0,N-1):
    if S[i] == "#" and S[i+1] == ".":
        S[i] == "."
        cnt += 1
    if i != N - 2:
        S[i] == "#" and S[i+1] == "#" and S[i+2] = ".":
        S[i+2] = "#"
        cnt += 1
    elif i >= N-2:
         S[i] == "#" and S[i+1] == "."
         S[i] == "."
         cnt += 1
print(cnt)
