def cutw(s,n):
    t = 0
    for i in range(n):
        if s[i] == '#':
            break
        else:
            t += 1
    s = s[t:]
    n = len(s)
    return s,n

def cutb(s,n):
    t = n
    for i in range(n-1, -1,-1):
        if s[i] == '.':
            break
        else:
            t -= 1
    s = s[:t]
    n = len(s)
    return s,n

def main():
    n = int(input())
    s = input()
    s,n = cutw(s,n)
    s,n = cutb(s,n)
    print(min(s.count('.'), s.count('#')))

if __name__ == '__main__':
    main()