N = int(input())
S = input()

import numpy as np
arr = np.empty(N+1,dtype='object')

for i in range(len(arr)):
    arr[i] ='.'*i+  '#'*(N-i)

countlist = []
for i in range(len(arr)):
    s = arr[i]
    c = 0
    for j in range(len(s)):
        if s[j] != S[j]:
            c += 1
    countlist.append(c)

print(min(countlist))