Z substring counter (ASCII-only for now)