def main():
    n = int(input())
    s = input().rstrip()
    i = 0
    b_count = 0
    w_count = 0
    # Comsume left whites
    while i < len(s):
        if s[i] == '.':
            i += 1
        else:
            break

    #Consume right blacks
    j = len(s) - 1
    while j > i:
        if s[j] != '.':
            j -= 1
        else:
            break

    while i <= j:
        if s[i] == '.':
            i += 1
            w_count += 1
        else:
            i += 1
            b_count += 1

    print(min(w_count, b_count))

if __name__ == "__main__":
    main()