# -*- coding: utf-8 -*-
n = int(input())
s = str(input())
s = s.replace(".", "0").replace('#', "1")
b = s.find("1")
a = 0
for i in range(b, n):
    a+=int(s[i])
s = [int(n) for n in s]
sums = sum(list(s))
if sums==0:
    print(0)
else:
    if n-b-a>sums:
        print(sums)
    else:
        print(n-b-a)