N = int(input())
S0 = input()
S = [S0[i] for i in range(N)]
minimum = N + 1

for i in range(N+1):
    m = 0
    for k in range(i):
        if S[k] != '.':
            m += 1
    for k in range(i, N):
        if S[k] != '#':
            m += 1
    if m < minimum:
        minimum = m

print(minimum)