def swap_count(s):
    # Filter only brackets
    brackets = [c for c in s if c in '[]']
    
    # Count minimum swaps needed to balance
    # We need equal number of '[' and ']'
    n = len(brackets)
    if n % 2 != 0:
        return -1  # Can't balance odd number of brackets
    
    open_count = brackets.count('[')
    close_count = brackets.count(']')
    
    if open_count != close_count:
        return -1  # Can't balance unequal counts
    
    swaps = 0
    imbalance = 0
    
    for c in brackets:
        if c == '[':
            imbalance += 1
        else:
            imbalance -= 1
        
        if imbalance < 0:
            # We have an extra ']', need to swap it with a future '['
            swaps += 1
            imbalance += 2  # After swap, this becomes '[' and somewhere ']'
    
    return swaps