Counting Bars

Hi All,

anyone here know how to count bars and identify current bar from previous bars?