If \( \vec{a} = \hat{i} + 2\hat{j} + \hat{k} \), \( \vec{b} = \hat{i} - \hat{j} + 4\hat{k} \), and \( \vec{c} = \hat{i} + \hat{j} + \hat{k} \) are such that \( \vec{a} + \lambda \vec{b} \) is perpendicular to \( \vec{c} \), then the value of \( \lambda \) is: