if __name__ == '__main__':
    n = int(input())
    s = input()
    s = s[:n]

    try:
        first_black = s.index('#')
    except ValueError as e:
        print(0)
        exit(0)

    s2 = s[first_black:]
    white_to_black = s2.count('.')
    print(min(s.count('#'), s2.count('.')))
