#import numpy as np
N = int(input())
S = input()

penals1 = []
penals2 = []
tmp1 = 0
tmp2 = 0

for i in range(N // 2 + 1):
    if S[i] == "#":
        tmp1 += 1
    
    if S[-(i+1)] == ".":
        tmp2 += 1
    penals1.append(tmp1)
    penals2.append(tmp1)

#min_p = [penals2[-1]] + [penals1[i] + penals2[-i] for i in range(N // 2 + 1)]
min_p = tmp1 + tmp2

j = 1
for i in range(N//2+1, N-1):
    if S[i] == "#":
        tmp1 += 1
    if S[-(i+1)] == ".":
        tmp2 += 1

    val1 = tmp1 + penals2[-j]
    val2 = penals1[-j] + tmp2
    val = min(val1, val2)
    if val < min_p:
        min_p = val
    j += 1

if S[N-1] == "#":
    tmp1 += 1
if S[0] == ".":
    tmp2 += 1

val = min(tmp1, tmp2)
if val < min_p:
    min_p = val

print(min_p)