N = int(input())
S = input()

if '.' not in S or '#' not in S:
    print(0)
    exit()

index = 0
for i in range(0,len(S)):
    if S[i] == '#':
        index = i
        break

cou=0
for i in range(index + 1,N):
    if S[i] == ".":
        cou += 1

index2 = 0
for i in range(N -1,0, -1):
    if S[i] == ".":
        index2 = i
        break

cou2 = 0
for i in range(0,index2):
    if S[i] == "#":
        cou2 +=1

print(min(cou,cou2))