n = int(input())
s = input()
black = 0
white = s.count('.')
min = n

if white == 0:
    print(0)
    exit()

for i in range(n):
    if s[i] == "#":
        black += 1
    else:
        white -= 1

    if black+white < min:
        min = black+white
print(min)
