Does any one know how to extract MCC,MNC codes from IMSI...?

I seen in 3GPP doc that the first 3 digits are MCC code and next 3 digits are MNC. but the confusion here is some countries have 2 digit network code and some other have 3 digit. so, how to find the MNC code..?

Let take this example, here MNC code can be 45 or 450.

404450014863533

Thanks,
Pramod.