ref_count (Reference Counter) is an internal information, rather meant for debugging purposes. Nevertheless, it should (in most cases) give you correct results. The only strange thing is, that you'll have to count +1:
\ A
\
*------ C
\ B
Here, the ref_count should be 2 (instead of 3) where
*
\
\
should return 0.