import numpy as np
N = int(input())
S = input()

nums= np.zeros(N+1, dtype=int)
for i, s in enumerate(S):
    if s == ".":
        nums[:i+1] += 1
    else:
        nums[i+1:] += 1

out = nums.min()
print(out)