import bisect
N = int(input())
S = input()
# 右全部#
b = []
w = []
for i in range(N):
    if S[i] == '#':
        b.append(i)
    if S[i] == '.':
        w.append(i)

kouho = []
for i in range(0,N+1):
    cost = 0
    #iから左を.、右を全部＃にする事を考える
    cost += i - bisect.bisect_right(w,i)
    cost += len(b) - bisect.bisect_right(b,i)
    
    if cost >= 0:
        kouho.append(cost)

print(kouho)
print(min(kouho))