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

idx_black = s.find(".")

if s.count(".") == 0 or s.count("#") == 0:
    print("0")
else:
    change_black = s[idx_black:].count(".")

    tail_black = s[::-1].find(".")
    change_white = s[idx_black - 1:].count("#") - tail_black

    print(min(change_black, change_white))

