N = int(input())
S = input()
 
S_t1 = [s for s in S]
c1 = 0
for i in range(1, len(S)):
  if S_t1[i-1]=='#' and S_t1[i]=='.':
    S_t1[i] = '#'
    c1 += 1
    
S_t2 = [s for s in S]
c2 = 0
for i in range(len(S)-1,0,-1):
  if S_t2[i-1]=='#' and S_t2[i]=='.':
    S_t2[i] = '.'
    c2 += 1
    
print(min(c1, c2))