num = int(input())
line = input()
result = 0
flg = 0
for i in range(num):
    if line[i] == "#":
        flg = 1
        continue
    if line[i] == "." and flg == 1:
        result += 1
        
print(result)
