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

ans = 2*10**5
c_b = 0
c_w = 0
for i in range(N):
    if S[i] == '#':
        c_b += 1
    else:
        c_w += 1

ans = min(ans, c_b, c_w)

count = 0
for i in range(N):
    if N <= N//2:
        if S[i] == '#':
            count += 1
    elif N > N//2:
        if S[i] == '.':
            count += 1

print(min(ans, count))