def main():
    _ = int(input())
    S = list(input())
    
    count_sharp = S.count('#')
    count_dot = S.count('.')
    # print(count_sharp, count_dot, count_sharp < count_dot)
    count = 0

    for i in range(1, len(S)):
        
        # print(S, end=' ')
        one = S[i-1]
        two = S[i]
        
        if count_sharp <= count_dot:
            if (one == '#') and (two == '.'):
                count += 1
                S[i-1] = '.'
            elif (one == '#') and (two == '#'):
                S[i-1] = '.'
                count += 1
        else:
            if (one == '#') and (two == '.'):
                count += 1
                S[i-1] = '.'
            # elif (one == '#') and (two == '#'):
            #     S[i-1] = '.'
            #     count += 1
        # print(count, end=' ')
        # print(S)

    print(count)
    # #..#.#....##...# -> (.)..(.).(.)....(.)(.)...#

main()