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