N = int(input())
S = input()
minVal = 0
#S[p] -> w
for p in range(N):
    tmp = 0
    for l in range(p):
        if S[l] == '#': tmp += 1
    for r in range(N-p):
        if S[p+r] == '.': tmp += 1
    minVal = min(minVal, tmp)
print(tmp)