n = int(input())
s = list(str(input()))
lis = []
for i in range(1,n):
  if s[i-1] =="." and s[i] == "#":
    lis.append(s[:i:].count("#") + s[i::].count("."))
if len(lis) == 0:
  print(0)
else:
  lis.sort()
  print(lis[0])