An iron rod when cut into pieces each of 30 cm length, a piece of 7 cm is left out. However, if each piece is of 28 cm length, a piece of 5 cm is left out. What is the length of the shortest such rod?