N = int(input())
K = list(input())
count = 0
count_b = 0
b=-1

for i in range(N):
    if K[i]=='#':
        b = i
        break
    else :
        continue

if b != -1:
    for j in range(N-b-1):
        if K[j+b+1] == '.':
            count+=1
        elif K[j+b+1] == '#':
            count_b +=1


c = min(count,count_b+1)

if c != N-1:
    print(c)
else:
    print(0)