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

num_of_black = 0
num_of_white = 0
for v in S:
    if v == '#':
        num_of_black += 1
    else:
        num_of_white += 1

a = N - num_of_black
b = N - num_of_white
print(min(a,b))