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

print(sharp_count)