N = int(input())
S = input()

kind = []
stone = []
change = []
s = 0

for i in range(N):
    if i == 0:
        kind.append(S[i])
        s += 1
    elif S[i-1] != S[i]:
        stone.append(s)
        kind.append(S[i])
        s = 1
    else:
        s += 1
    if i == N-1:
        stone.append(s)

if len(kind)==1:
    print(0)
else: 
    min = 0
    # print(kind, stone)
    if kind[0] == '.':
        start = 1
    else:
        start = 0 
    # .の数を数えて足す
    for i in range(start+1,len(stone),2):
        min += stone[i]
        # print('i=', i, 'min=', min)
    # #の個数を持つstoneのindexがi
    for i in range(start,len(stone),2):
        if i==start:
            tmp = min
        else:
            tmp += stone[i-2]
            tmp -= stone[i-1]
        if tmp < min:
            min = tmp
    print(min)
