N = int(input())
S = input()

fb = -1
lw = -1
awc = 0
abc = 0
fbrwc = 0
lwlbc = 0
work = 0
for i in range(N):
  if S[i] == '.':
    awc += 1
    lwlbc += work
    work = 0
    if fb >= 0:
      fbrwc += 1
  if S[i] == '#':
    abc += 1
    work += 1
    if fb <0:
      fb = i
count = []
count.append(awc)
count.append(abc)
count.append(lwlbc)
count.append(fbrwc)
print(min(count))
