N = int(input())
S = input()

w = S.count(".")
bl = S.count("#")

cnt = 0
for i in S[::-1]:
    if i != "#":
        break
    cnt += 1
bl -= cnt
cnt = 0
for i in S:
    if i != ".":
        break
    cnt += 1
w -= cnt
print(min(w, bl))