N = int(input())
S = input()
a = [0] * N
b = [0] * N
counter = []

if S[0] == '#':
    a[0] = 1
if S[N-1] == '.':
    b[N-1] = 1

for i in range(N-1):
    if S[i+1] == '#':
        a[i+1] = a[i] + 1
    else:
        a[i+1] = a[i]
    if S[N-i-2] =='.':
        b[N-i-2] = b[N-i-1] + 1
    else:
        b[N-i-2] = b[N-i-1]
        
for i in range(N-1):
    counter.append(a[i] + b[i+1])

print(min(counter))
