# -*- 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 = list(str(input()))

Sw = copy.deepcopy(S)
Sb = copy.deepcopy(S)

w = 0
b = 0

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