N = int(input())
S = list(input())
black = S.count('#')
white = S.count('.')
count = 0
if black > white:
    for i in range(0,N-1):
        if S[i]=='#' and S[i+1]=='.':
            S[i+1]='#'
            count += 1
else:
    for i in range(0,N-1):
        if S[i]=='#' and S[i+1]=='.':
            S[i+1]='.'
            count += 1
print(count)
