n = input()
s = input()
white_change = 0 if s.count("#") == 0 else s[s.index("#"):].count(".")
print(white_change if white_change < s.count("#") else s.count("#") - 1 if s[-1] == "#" else s.count("#"))
