import sys

N = int(sys.stdin.readline())
S = sys.stdin.readline().rstrip()

countW = 0
count_left_B = 0
countB = 0
for i in range(len(S)):
    if S[i] == ".":
        countW += 1
    else:
        countB += 1

for i in range(len(S)):
    if S[i] == "#":
        count_left_B += 1
    else:
        break

numW = countW
numB = countB - count_left_B

if numB > numW:
    print(numW)
else:
    print(numB)