n = int(input())
s = input()

for i, c in enumerate(s):
    if c == "#":
        s = s[i:]
        break

count_hash = s.count("#")
count_period = s.count(".")

if count_hash >= count_period:
    print(count_period)
else:
    print(count_hash)