n = int(input())
s = input()
s1 = s

flag = True

if s[0] == '#':
    flag = False
else:
    for i in range(n-1):
        if s[i] == '.' and s[i+1] == '#':
            s = s[i+1:]
            flag = False
            break

if flag == False:
    a = s.count('.')
else:
    a = 0

flag = True

if s1[n-1] == '.':
    flag = False
else:
    for i in range(n-1):
        if s1[n-i-1] == '#' and s1[n-i-2] == '.':
            s1 = s1[:n-i-1]
            flag = False
            break

if flag == False:
    b = s1.count('#')
else:
    b = 0

print(min(a,b))
