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

cnt = 0
kurodeta = False
for i, isi in enumerate(S):
    if not kurodeta and isi == ".":
        continue
    if isi == "#":
        kurodeta = True

    if isi == ".":
        cnt += 1

ccnt = 0
for i in range(len(S)-1, 0, -1):
    if S[i] == ".":
        break
    else:
        S = S[:len(S)-1]

ccnt = S.count("#")

print(min([cnt, ccnt]))
