def main():
    N=int(input())
    line = list(input())
    flag = False
    cnt_W = 0
    cnt_B = 0
    for i in range(N):

        if line[N-i-1] ==".":
            flag = True
        if flag == True:
            for j in range(N-i):
                if line[j] ==".":
                    cnt_W +=1
                else:
                    cnt_B +=1
            break
    return min(cnt_W,cnt_B)

print(main())