def checkLeft(left):
    count = left.count('#')
    left = left.replace('#','.')

    return count

def checkRight(right):
    count = right.count('.')
    right = right.replace('.','#')

    if count == len(right):
        count = 0

    return count

#改行入力
N = int(input())
S = input()

count = 0

min = len(S)+1

for i in range(len(S)):
    # print(S[i])

    left = S[:i]
    right = S[i:]

    left_count = checkLeft(left)
    right_count = checkRight(right)

    result = left_count + right_count

    if result < min:
        min = result



print(min)