Chimney

Does anyone know what is the code for the minimal distance of the chimney (Type A) from the centerline of the roof valley? I believe it is 18" since the flashing is generaly required to be 3’ - that is 18" to each side, but I remember reading somewhere that it has to be 24". Do you guys have any references?
thanks