This program will return the minimum number of multiplications needed to multiply the chain of matrices. Matrices A, B, C, D can be multiplied in ways such as (ABC)D, (AB)(CD), A(BC)D, etc. So, for finding the method with the minimum number of multiplications, this functions proves to be useful.