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

count=[]
for i in range(len(S)+1):
    count_temp=0
    left = S[:i]
    right = S[i:]
    for _ in left:
        count_temp += 1 if _!='.' else 0
    for _ in right:
        count_temp += 1 if _!='#' else 0
        
    count.append(count_temp)

print(min(count)) 