N = int(input())
S = list(input())
BS = []
WS = []
BS += S
WS += S

b_count=0
w_count=0

for i in range(N-1):
    if BS[i]=='#' and BS[i+1]=='.' :
        BS[i+1]='#'
        b_count+=1
    if WS[N-(i+1)]=='.' and WS[N-(i+2)]=='#' :
        WS[N-(i+2)]='.'
        w_count+=1
ans = b_count if w_count==0 else w_count
if b_count != 0 and w_count != 0:
    ans = min(b_count,w_count)
print(ans)