N = int(input())
S = list(input())
S2 = S.copy()

res = 0
res2 = 0
for i in range(1,N):
    if S[i]=='.' and S[i-1]=='#':
        S[i]='#'
        res+=1

    if S2[i]=='#' and S2[i-1]=='.':
        S2[i]='.'
        res2+=1

if res>res2:
    print(res2)
else:
    print(res)
