Minecraft wiki entry for clear, associated text: Specifies the maximum number of items to be cleared. If not specified, or if -1‌[Bedrock Edition only], all items that match item, or itemName: Item and data: int are cleared. If 0, instead of clearing of items, detects and queries the amount of specified items.
Must be a 32-bit integer number. In Java Edition, it must be between 0 and 2147483647 (inclusive). In Bedrock Edition, it must be between -1 and 2147483647 (inclusive).