input()
S = [1 if v == "." else 0 for v in input()]

count = 0
for s in S:
    if s == 0:
        break
    count += 1

rcount = 0
for s in S[::-1]:
    if s == 1:
        break
    rcount += 1

ones = sum(S) - count
zeros = len(S) - sum(S) - rcount
print(min(ones, zeros))
