How to check Minecraft Item in Inventory?

au
1

/ execute if entity @p [nbt = {SelectedItem: {id: "minecraft: diamond"}}] run title @a title "You have a Dia"

The command issues a title when I hold a diamond in my hand. But I want the title to be played when I hold 64 diamonds in my hand. How does it work?

Ic

There must believe the number behind it look briefly at yt