calc of kms