N = int(input())
S = input()                                                      
list_S = list(S)
N1 = 0
list_X =[]
X = list_S.count('.')
list_X.append(X)
    
for color in list_S:
        list_S1 = list_S[N1]
        if list_S[N1] == '.':
            X -= 1
            list_X.append(X)
            N1 +=1
        else:
            X += 1
            list_X.append(X)
            N1 +=1

X = list_S.count('#') 
list_X.append(X)

print(list_X)
X_MIN = min(list_X)
print(X_MIN)