def count_ops(code):
    """Count the number of operations in code (multiply-add pairs)."""
    num_add = code.count(' + ') + code.count(' - ')
    num_multiply = code.count('*') + code.count('/')
    return (num_add + num_multiply) // 2
