N = int(input())
S = input()                                                      
list_S = list(S)
N1 = 0
X1 = 0
X2 = 0
X1MIN = 0
X2MIN = 0
list_X = []

for color in list_S:
    if color == '.':
            N1 +=1
    else:
        list_S1 = list_S[N1:]
        list_S2 = list_S[:N1]
        X1 = list_S1.count('.')
        X2 = list_S2.count('#')
        X = X1 + X2
        list_X.append(X)
        N1 +=1

X_MIN = min(list_X1)
print(X_MIN)