Estimation of stellar metal abundance. I - Calibration of the CA II K index