import sys
from itertools import accumulate

def main():
    input = sys.stdin.readline
    N = int(input())
    S = [0 if c == '.' else 1 for c in input().strip()]
    T = [0] + list(accumulate(S))

    B = T[N]
    if B == 0 or B == N:
        return 0

    ans = 10**5
    for i in range(N+1):
        convert_w = T[i]
        convert_b = N - (B - T[i])
        ans = min(ans, convert_w + convert_b)

    return ans


if __name__ == '__main__':
    print(main())
