import sys,math,collections,itertools
input = sys.stdin.readline

N = int(input())
s = input().rstrip()
sr = s[::-1]

sl = list(s)
srl = list(sr)

cnt = 0
cntr = 0
for i in range(1,len(sl)):
    if sl[i-1]=='#' and sl[i]=='.':
        cnt +=1
        sl[i]='#'
    if srl[i-1]=='.' and srl[i] == '#':
        cntr += 1
        srl[i]='.'
print(min(cnt,cntr))
    
    
