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

listS = list(S)
temp = 0
result = float('inf')
black = 0

for i in range(N):
    temp = listS[:i+1].count('#') + listS[i+1:].count('.')
    if result > temp:
        result = temp

count1 = listS[:N-1].count('#')
print(min(result, count1))
