# -*- coding: utf-8 -*-

n = int(input())
s = str(input())
"""
n = 10
s = "..###...#."
"""
s = s.replace(".", "0").replace('#', "1")
b = s.find("1")

a = 0
for i in range(b, n-b+1):
    a+=int(s[i])
print(n-b-a)