Accessing values on a gameobject

So I am fairly new to unity and programming I have 6 gameobjects called Upgrade1, Upgrade2 etc, and i want to access the count variable in their script for each individual one and manipulate that from another script

The Upgrade Manager Class
public void PurchasedUpgrade(){
     if(click.gold >= cost) {
	  click.gold -= cost;
	  count += 1;
	  click.goldperclick += clickPower;
	  cost = Mathf.Round (baseCost * Mathf.Pow (1.25f, count));
	 }
  }

and then i have the persistence script

 public void Fred()
    {

    upgrademanager = GetComponent<UpgradeManager>();

and i need to do this to get the count value from each individual item so what should i do in the persistence script Sorry if this question is confusing i dont know too much about programming and unity. I have done a few tutorials though.

Get Reference of Your class in the persistent script and access it count.
Then You Can Assign it from the inspector or find with the type.

public  class UpgradeManager
{
    public  GameObject[] _objects;
    public int Count;
}

public class Persistent
{
    private UpgradeManager _myClass;

    private void Start()
    {
        _myClass = GameObject.FindObjectOfType<UpgradeManager>();
        _myClass.Count = 5;
    }
}