N = int(input())
S = input()
min = N
for i in range(N-1):
    if '.' not in S or '#' not in S:
        min = 0
        break
    if S[i] == '.' and S[i+1] == '#':
        left = S.count('#',0,i+1)
        right = S.count('.',i+1)
    elif S[i] == '#' and S[i+1] =='.':
        left = S.count('#',0,i)
        right = S.count('.',i)
    if left + right < min:
        min = left + right
print(min)