N = int(input())
S = str(input())

def main_f():
    first_sharp = S.find('#')
    if first_sharp == -1:
        print(0)
        return
    
    sub_s = S[first_sharp:]
    sharp_num = sub_s.count('#')
    dot_num = sub_s.count('.')
    print(min(sharp_num, dot_num))

main_f()