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

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



        # print(S)

    print(count)

main()