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

start = -1
black = 1
white = 0
start2 = -1
black2 = 0
white2 = 1

for i in range(n):
    if s[i] == "#":
        start = i
        break

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

for i in range(n):
    if s[n-i-1] == ".":
        start2 = n-i-1
        break

if start != -1:
    for i in range(n):
        if n-i < start2:
            if s[i] == "#":
                black2+=1
            else:
                white2+=1

if start == -1 or start2 == -1:
    print(0)
else:
    if black < white and black < black2 and black < white2:
        print(black)
    elif white < black and white < black2 and white <white2:
        print(white)
    elif black2 < black and black2 < white and black2 < white2:
        print(black2)
    else:
        print(white2)