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