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