# C- Stones

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

#print(N)
#print(S)

# 普通にループ
white = 0
black = 0
for i in range(N):
    if S[i] == ".":
        white += 1
    else:
        black += 1

if white == 0 or black == 0:
    print("0")
else:
    if white > black:
        print(black)
    else:
        print(white)
