#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()

nums = [0 for i in range(N+1)]

for i, s in enumerate(S):
    if s == ".":
        for j in range(0, i):
            nums[j] += 1
    else:
        for j in range(i+1, N+1):
            nums[j] += 1

out = min(nums)
print(out)