Version numbering script

Found this script somewhere on the internet. It make's version control much more suitable in a LaTeX document. In this script, the version starts with V0.<number>. Each time you save, the number increases (like x+1).

\documentclass{article}
 
\newcounter{run}
\InputIfFileExists{\jobname.runs}{}{}
\stepcounter{run}
 
\usepackage{atveryend}
\usepackage{newfile}
\AtVeryEndDocument{%
  \newoutputstream{runs}%
  \openoutputfile{\jobname.runs}{runs}%
  \addtostream{runs}{\string\setcounter{run}{\number\value{run}}}%
  \closeoutputstream{runs}%
}
 
\begin{document}
 
Output: V0.\therun
 
\end{document}