n = int(input())
s = str(input())
min_cnt = len(s)
for i in range(len(s)+1):
    tmp1 = s[:i]
    tmp2 = s[i:]
    #print("----")
    #print(tmp1)
    #print(tmp2)
    tmp_cnt = tmp1.count('#')+tmp2.count('.')
    print(tmp_cnt)
    if min_cnt > tmp_cnt:
        min_cnt = tmp_cnt
print(min_cnt)
