p=Plot[Sin[x],{x,0,20}]

Total[Cases[p,x_Line:>Length[x[[1]]],Infinity]]