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