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

ans = 0
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:
    print(s.count('.'))
else:
    print(0)
