Simple:
in your vi, write a value to a file (can even be a text file). For instance, if using text file, open it, write 0, and save it (call it something like runcount.txt)
Every time you run your program, open your file, read the value, increment the value (if string convert to number first), and store it to the same file. DO NOT append to file because you will store a whole bunch of numbers. If you do not append, it will write over your value and you'll only have one number.
You can use an Excel spreadsheet or other means as well..
I tried to keep it simple.
JLV