n = int(input())
s = input()
if "#." not in s:
    print(0)
else:
    if s[0] == "#":
        print(min(s.count("."), s.count("#")))
    else:
        seq = 0
        for i in range(n):
            if s[i] == ".":
                seq += 1
            else:
                break
        print(min(s.count(".") - seq, s.count("#")))

