N = int(input())
S = input()
if N == 1:
    print("0")
    exit()
for i in range(N-1):
    if S[i] == "#"and S[i+1] == ".":
        break
count = 0
for j in range(i,N):
    if S[j] == ".":
        count +=1
print(count)