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

l = [0] * len(S)
for i, s in enumerate(S):
    if s is '.':
        if i == 0:
            l[i] = 1
        else:
            l[i] = l[i-1] + 1
    else:
        if i == 0:
            l[i] = 0
        else:
            l[i] = l[i-1]

ans = -1
for i in range(len(S)):
    lsh = i + 1 - l[i]
    rdo = l[len(S)-1] - l[i]
    if ans == -1:
        ans = lsh + rdo
    else:
        if lsh + rdo < ans:
            ans = lsh + rdo
if len(S) == 1:
    print(0)
else:
    print(ans)