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

finded_white = False
answer2 = 0

tmp = list(reversed(s))

for c in tmp:
    if finded_white:
        if c == '.':
            continue
        else:
            answer2 += 1

    if not finded_white:
        if c == '#':
            continue
        else:
            finded_white = True

print(min(answer1, answer2))