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

S_list = list(S)
firstBlack = N
countStone = 0
for i in range(0, N):
  if(S_list[i] == "#"):
    firstBlack = i
    break

for i in range(firstBlack, N):
  if(S_list[i] == "."):
    countStone = countStone + 1
    
print(countStone)
    