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

if (s.count('.') == 0):
  print('0');
  exit()
if (s.count('#') == 0):
  print('0');
  exit()

white = 0
black = 0


# for i in range(len(s)):
#   print(i, s[i])
# for i in range(len(s)-1, -1, -1):
#   print(i, s[i])
  

for i in range(len(s)):
  if s[i] == '.':
    break    

left_black = i

for i in range((i+1), len(s)):
  if s[i] == '#':
    break

count = 0
for j in range((i+1), len(s)):
  # print(j, s[j])
  if s[j] == '.':
    count += 1

right_white = count

# print(left_black, right_white)

white = left_black + right_white



for i in range(len(s)-1, -1, -1):
  if s[i] == '#':
    break

right_white = (n-1-i)
    
for i in range((i-1), -1, -1):
  if s[i] == '.':
    break

count = 0
for j in range((i-1), -1, -1):
  # print(j, s[j])
  if s[j] == '#':
    count += 1

right_white = count

# print(left_black, right_white)

black = left_black + right_white

if white < black:
  print(white)
else:
  print(black)
