//Radin Pouya
//Feb 3, 2020
//Int5
//Enloe
//Potter
#include
#include
#include
#include
#include 
using namespace std;
void sizetempset(vector  VecLine1, vector  VecLine2, int & SizeTemp)
{
   if (int(VecLine1.size() - VecLine2.size()) < 0)
					SizeTemp = VecLine1.size();
				else if (int(VecLine1.size() - VecLine2.size()) > 0)
					SizeTemp = VecLine2.size();
				else
					SizeTemp = VecLine1.size();
}
int main()
{
	string FileInput1, FileInput2;
	vector  VecLine1;
	vector  VecLine2;
	bool Runner, Limiter;
	int SizeTemp, ASF, InputNum = 1;

	ifstream myfile("input.txt");
	{
		if (myfile.is_open())
		{
			while (myfile.good())
			{
				cout << "Number: " << InputNum << endl;
				ASF = 0;

				myfile >> FileInput1;
				myfile >> FileInput2;
				for (int i = 0; i < FileInput1.length(); i++)
					VecLine1.push_back(FileInput1[i]);
				for (int i = 0; i < FileInput2.length(); i++)
					VecLine2.push_back(FileInput2[i]);

                VecLine1.push_back(0);
				VecLine2.push_back(1);
				sizetempset(VecLine1, VecLine2, SizeTemp);

				Limiter = false;
				while (Limiter == false)
				{
					Limiter = true;
					Runner = false;
					for (int i = 0; i < SizeTemp; i++)
					{
						if (VecLine1[i] == VecLine2[i])
						{
							VecLine1.erase(VecLine1.begin() + i);
							VecLine2.erase(VecLine2.begin() + i);
							i--;
							SizeTemp--;
							Runner = true;
							Limiter = false;
						}
					}
					if (Runner == false) {
						for (int i = 1; i < SizeTemp; i++)
						{
								if (VecLine1[i] == VecLine2[i - 1])
								{
									VecLine1.erase(VecLine1.begin() + (i-1));
                                    sizetempset(VecLine1, VecLine2, SizeTemp);
									i = SizeTemp;
									Limiter = false;
								}
								else if (VecLine2[i] == VecLine1[i - 1])
								{
									VecLine2.erase(VecLine2.begin() + (i-1));
                                    sizetempset(VecLine1, VecLine2, SizeTemp);
									i = SizeTemp;
									Limiter = false;
								}
						}
					}
				}
                VecLine1.erase(VecLine1.begin() + (int(VecLine1.size()) - 1));
				VecLine2.erase(VecLine2.begin() + (int(VecLine2.size()) - 1));
                sizetempset(VecLine1, VecLine2, SizeTemp);

				for (int i = 0; i < SizeTemp; i++)
				{
					ASF += VecLine1[i] - VecLine2[i];
				}
				if (int(VecLine1.size() - VecLine2.size()) < 0)
				{
					for (int i = SizeTemp; i < VecLine2.size(); i++)
					{
						ASF += 1;
					}
				}
				else if (int(VecLine1.size() - VecLine2.size()) > 0)
				{
					for (int i = SizeTemp; i < VecLine1.size(); i++)
					{
						ASF += 1;
					}
				}

				cout << "ASF: " << ASF << endl;
				cout << "VecLine1: ";
				for (int i = 0; i < VecLine1.size(); i++)
				{
					cout << VecLine1[i];
				}
				cout << endl;
				cout << "VecLine2: ";
				for (int i = 0; i < VecLine2.size(); i++)
				{
					cout << VecLine2[i];
				}
				cout << endl;
				cout << endl;
				VecLine1.clear();
				VecLine2.clear();
				InputNum++;
			}
		}
		myfile.close();
	}
}