N = int(input())
S = list(input())
b_start = N
w_goal = -1
for i in range(N):
    if S[i]=='#':
        b_start=i
        break
for i in range(N-1,-1,-1):
    if S[i]=='.':
        w_goal = i
        break
if b_start>w_goal:
    print(1)
else:
    S = S[b_start:w_goal+1]
    print(min(S.count('.'),S.count('#')))