don't duplicate the entire tree just to ask how many you need

multiply the amount needed to craft 1 stack by how many stacks you can
craft.