  Contextuality is central to both the foundations of quantum theory and to the
novel information processing tasks. Although it was recognized before Bell's
nonlocality, despite some recent proposals, it still faces a fundamental
problem: how to quantify its presence? In this work, we provide a framework for
quantifying contextuality. We conduct two complementary approaches: (i)
bottom-up approach, where we introduce a communication game, which grasps the
phenomenon of contextuality in a quantitative manner; (ii) top-down approach,
where we just postulate two measures - relative entropy of contextuality and
contextuality cost, analogous to existent measures of non-locality (a special
case of contextuality). We then match the two approaches, by showing that the
measure emerging from communication scenario turns out to be equal to the
relative entropy of contextuality. We give analytical formulas for the proposed
measures for some contextual systems. Furthermore we explore properties of
these measures such as monotonicity or additivity.
