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

li = list(S)
count = 2 * 10 ** 5
black = 0

for i in range(N):
    if '#' == S[i]:
        black += 1
    white = S[i+1:].count('.')
    count = min(count, black+white)
print(count)
