# -*- 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())

w = 0
b = 0

for i in range(N-1) :
  if S[i] == "#" and S[i+1] == "." :
    b += 1
  if S[N-i-1] == "." and S[N-i-2] == "#" :
    w += 1
print (min(b, w))
    
    
  
  
