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