# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
N = int(input())
S = str(input())

f = False
w = 0
b = 0
for i in range(N) :
  if f == False :
    if S[i] != "." :
      f = True
  else :
    if S[i] == "." :
      w += 1
    else :
      b += 1
print (min(w, b))
    
    
  
  
