n = int(input())
s = input()

finded_black = False
answer1 = 0

for c in s:
    if finded_black:
        if c == '#':
            continue
        else:
            answer1 += 1

    if not finded_black:
        if c == '.':
            continue
        else:
            finded_black = True


black_count = 0

for c in s:
    if c == '#':
        black_count += 1

print(min(answer1, black_count))