import numpy as np
N = int(input())
S = np.array(list(input()))

minimum = []
for i in range(0,len(S)+1):
    str1 = ["."]*i
    str2 = ["#"]*(len(S)-i)
    str3 = str1 + str2
    str3 = np.array(str3)
    x = str3==S
    minimum.append(np.sum(x==False))
print(np.min(minimum))