  We define an invariant of contact structures in dimension three from Heegaard
Floer homology. This invariant takes values in the set
$\mathbb{Z}_{\geq0}\cup\{\infty\}$. It is zero for overtwisted contact
structures, $\infty$ for Stein fillable contact structures, non-decreasing
under Legendrian surgery, and computable from any supporting open book
decomposition. As an application, we obstruct Stein fillability on contact
3-manifolds with non-vanishing Ozsv\'ath-Szab\'o contact class.
