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

b_count = [0]*(N+1)
w_count = [0]*(N+1)

for i in range(1,len(S)):
    if S[i] == "#":
        b_count[i] = b_count[i-1] + 1
    else:
        b_count[i] = b_count[i-1]

for i in range(len(S)-1,-1,-1):
    if S[i] == ".":
        w_count[i] = w_count[i+1] + 1
    else:
        w_count[i] = w_count[i+1]

#print(b_count)
#print(w_count)

res = float('inf')
for i in range(len(S)+1):
    tmp = b_count[i] + w_count[i]
    res = min(res,tmp)

print(res)