import java.util.*;

public class Main {
	static int mod = 1000000007;
  static int size = 200000;
	static long[] fac = new long[size];
	static long[] finv = new long[size];
	static long[] inv = new long[size];
	static int INF = Integer.MAX_VALUE;

 	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		int n = s.length();
		char[] c = new char[n];
		for(int i = 0; i < n; i++){
			c[i] = s.charAt(i);
		}
		if(n == 2){
			System.out.print(c[0]);
			for(int j = 51; j > 26; j--){
				if(c[1] != i2c(j)){
					System.out.print(i2c(j));
					break;
				}
			}
			return;
		}
		for(int i = 1; i < n-1; i++){
			if(c[i-1] == c[i]){
				for(int j = 51; j > 26; i--){
					if(c[i] != i2c(j) && c[i+1] != i2c(j)){
						c[i] = i2c(j);
						break;
					}
				}
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print(c[i]);
		}
	}
	// tar の方が数字が大きいかどうか
static boolean compare(String tar, String src) {
	if (src == null) return true;
	if (src.length() == tar.length()) {
		int len = tar.length();
		for (int i = 0; i < len; i++) {
			if (src.charAt(i) > tar.charAt(i)) {
				return false;
			} else if (src.charAt(i) < tar.charAt(i)) {
				return true;
			}
		}
		return tar.compareTo(src) > 0 ? true : false;
	} else if (src.length() < tar.length()) {
		return true;
	} else if (src.length() > tar.length()) {
		return false;
	}

	return false;
}
	public static class Edge{
		int to;
		Edge(int to){
			this.to = to;
		}
	}
	public static void swap(long a, long b){
		long tmp = 0;
		if(a > b){
			tmp = a;
			a = b;
			b = tmp;
		}
	}
  static class Pair implements Comparable<Pair>{
    int first, second;
    Pair(int a, int b){
        first = a;
        second = b;
    }
    @Override
    public boolean equals(Object o){
        if (this == o) return true;
        if (!(o instanceof Pair)) return false;
        Pair p = (Pair) o;
        return first == p.first && second == p.second;
    }
    @Override
    public int compareTo(Pair p){
        return first == p.first ? second - p.second : first - p.first; //firstで昇順にソート
        //return (first == p.first ? second - p.second : first - p.first) * -1; //firstで降順にソート
        //return second == p.second ? first - p.first : second - p.second;//secondで昇順にソート
        //return (second == p.second ? first - p.first : second - p.second)*-1;//secondで降順にソート
    }
  }

  //繰り返し二乗法
  public static long pow(long x, long n){
    long ans = 1;
    while(n > 0){
      if((n & 1) == 1){
        ans = ans * x;
        ans %= mod;
      }
      x = x * x % mod;
      n >>= 1;
    }
    return ans;
  }

	public static long div(long x, long y){
		return (x*pow(y, mod-2))%mod;
	}

  //fac, inv, finvテーブルの初期化、これ使う場合はinitComb()で初期化必要
	public static  void initComb(){
		fac[0] = finv[0] = inv[0] = fac[1] = finv[1] = inv[1] = 1;
		for (int i = 2; i < size; ++i) {
			fac[i] = fac[i - 1] * i % mod;
			inv[i] = mod - (mod / i) * inv[(int) (mod % i)] % mod;
			finv[i] = finv[i - 1] * inv[i] % mod;
		}
	}

	//nCk % mod
	public static long comb(int n, int k){
		return fac[n] * finv[k] % mod * finv[n - k] % mod;
	}

	//n! % mod
	public static long fact(int n){
		return fac[n];
	}

	//(n!)^-1 with % mod
	public static long finv(int n){
		return finv[n];
	}

  static class UnionFind {
    int[] parent;
    public UnionFind(int size) {
      parent = new int[size];
      Arrays.fill(parent, -1);
    }
    public boolean unite(int x, int y) {
      x = root(x);
      y = root(y);
      if (x != y) {
        if (parent[y] < parent[x]) {
          int tmp = y;
          y = x;
          x = tmp;
        }
        parent[x] += parent[y];
        parent[y] = x;
        return true;
      }
      return false;
    }
    public boolean same(int x, int y) {
      return root(x) == root(y);
    }
    public int root(int x) {
      return parent[x] < 0 ? x : (parent[x] = root(parent[x]));
    }
    public int size(int x) {
      return -parent[root(x)];
    }
  }
	public static int upperBound(long[] array, long value) {
			 int low = 0;
			 int high = array.length;
			 int mid;
			 while( low < high ) {
					 mid = ((high - low) >>> 1) + low; // (high + low) / 2
					 if( array[mid] <= value ) {
							 low = mid + 1;
					 } else {
							 high = mid;
					 }
			 }
			 return low;
	 }
	 public static final int lowerBound(final int[] arr, final int value) {
    int low = 0;
    int high = arr.length;
    int mid;
    while (low < high) {
        mid = ((high - low) >>> 1) + low;    //(low + high) / 2 (オーバーフロー対策)
        if (arr[mid] < value) {
            low = mid + 1;
        } else {
            high = mid;
        }
    }
    return low;
}
  //n,mの最大公約数
  public static long gcd(long n, long m){
    if(m > n) return gcd(m,n);
    if(m == 0) return n;
    return gcd(m, n%m);
  }
	//3要素のソート
	private class Pair2 implements Comparable<Pair2> {
		String s;
		int p;
		int index;
		public Pair2(String s, int p, int index) {
				this.s = s;
				this.p = p;
				this.index = index;
		}

		public int compareTo(Pair2 other) {
				if (s.equals(other.s)) {
						return other.p - this.p;
				}
				return this.s.compareTo(other.s);
		}
	}
	//c -> intに変換
public static long c2i(char c){
	if('A' <= c && c <= 'Z'){
		return c - 'A';
	}else{
		return c - 'a' + 26;
	}
}
// int -> charに変換
public static char i2c(long i){
	if(0 <= i && i < 26){
			return (char)(i + 'A');
	}else{
			return (char)(i + 'a' - 26);
	}
}

}


import java.util.*;

public class Main {
	static int mod = 1000000007;
  static int size = 200000;
	static long[] fac = new long[size];
	static long[] finv = new long[size];
	static long[] inv = new long[size];
	static int INF = Integer.MAX_VALUE;

 	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		int n = s.length();
		char[] c = new char[n];
		for(int i = 0; i < n; i++){
			c[i] = s.charAt(i);
		}
		if(n == 1){
			System.out.println(c[0]);
			return;
		}
		if(n == 2){
			System.out.print(c[0]);
			for(int j = 51; j > 26; j--){
				if(c[1] != i2c(j)){
					System.out.print(i2c(j));
					break;
				}
			}
			return;
		}
		for(int i = 1; i < n; i++){
			if(c[i-1] == c[i] && i < n-1){
				for(int j = 51; j > 26; j--){
					if(c[i] != i2c(j) && c[i+1] != i2c(j)){
						c[i] = i2c(j);
						break;
					}
				}
			}
		}
		if(c[n-2] == c[n-1]){
			for(int j = 51; j > 26; j--){
				if(c[n-1] != i2c(j)){
					c[n-1] = i2c(j);
					break;
				}
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print(c[i]);
		}
	}
	// tar の方が数字が大きいかどうか
static boolean compare(String tar, String src) {
	if (src == null) return true;
	if (src.length() == tar.length()) {
		int len = tar.length();
		for (int i = 0; i < len; i++) {
			if (src.charAt(i) > tar.charAt(i)) {
				return false;
			} else if (src.charAt(i) < tar.charAt(i)) {
				return true;
			}
		}
		return tar.compareTo(src) > 0 ? true : false;
	} else if (src.length() < tar.length()) {
		return true;
	} else if (src.length() > tar.length()) {
		return false;
	}

	return false;
}
	public static class Edge{
		int to;
		Edge(int to){
			this.to = to;
		}
	}
	public static void swap(long a, long b){
		long tmp = 0;
		if(a > b){
			tmp = a;
			a = b;
			b = tmp;
		}
	}
  static class Pair implements Comparable<Pair>{
    int first, second;
    Pair(int a, int b){
        first = a;
        second = b;
    }
    @Override
    public boolean equals(Object o){
        if (this == o) return true;
        if (!(o instanceof Pair)) return false;
        Pair p = (Pair) o;
        return first == p.first && second == p.second;
    }
    @Override
    public int compareTo(Pair p){
        return first == p.first ? second - p.second : first - p.first; //firstで昇順にソート
        //return (first == p.first ? second - p.second : first - p.first) * -1; //firstで降順にソート
        //return second == p.second ? first - p.first : second - p.second;//secondで昇順にソート
        //return (second == p.second ? first - p.first : second - p.second)*-1;//secondで降順にソート
    }
  }

  //繰り返し二乗法
  public static long pow(long x, long n){
    long ans = 1;
    while(n > 0){
      if((n & 1) == 1){
        ans = ans * x;
        ans %= mod;
      }
      x = x * x % mod;
      n >>= 1;
    }
    return ans;
  }

	public static long div(long x, long y){
		return (x*pow(y, mod-2))%mod;
	}

  //fac, inv, finvテーブルの初期化、これ使う場合はinitComb()で初期化必要
	public static  void initComb(){
		fac[0] = finv[0] = inv[0] = fac[1] = finv[1] = inv[1] = 1;
		for (int i = 2; i < size; ++i) {
			fac[i] = fac[i - 1] * i % mod;
			inv[i] = mod - (mod / i) * inv[(int) (mod % i)] % mod;
			finv[i] = finv[i - 1] * inv[i] % mod;
		}
	}

	//nCk % mod
	public static long comb(int n, int k){
		return fac[n] * finv[k] % mod * finv[n - k] % mod;
	}

	//n! % mod
	public static long fact(int n){
		return fac[n];
	}

	//(n!)^-1 with % mod
	public static long finv(int n){
		return finv[n];
	}

  static class UnionFind {
    int[] parent;
    public UnionFind(int size) {
      parent = new int[size];
      Arrays.fill(parent, -1);
    }
    public boolean unite(int x, int y) {
      x = root(x);
      y = root(y);
      if (x != y) {
        if (parent[y] < parent[x]) {
          int tmp = y;
          y = x;
          x = tmp;
        }
        parent[x] += parent[y];
        parent[y] = x;
        return true;
      }
      return false;
    }
    public boolean same(int x, int y) {
      return root(x) == root(y);
    }
    public int root(int x) {
      return parent[x] < 0 ? x : (parent[x] = root(parent[x]));
    }
    public int size(int x) {
      return -parent[root(x)];
    }
  }
	public static int upperBound(long[] array, long value) {
			 int low = 0;
			 int high = array.length;
			 int mid;
			 while( low < high ) {
					 mid = ((high - low) >>> 1) + low; // (high + low) / 2
					 if( array[mid] <= value ) {
							 low = mid + 1;
					 } else {
							 high = mid;
					 }
			 }
			 return low;
	 }
	 public static final int lowerBound(final int[] arr, final int value) {
    int low = 0;
    int high = arr.length;
    int mid;
    while (low < high) {
        mid = ((high - low) >>> 1) + low;    //(low + high) / 2 (オーバーフロー対策)
        if (arr[mid] < value) {
            low = mid + 1;
        } else {
            high = mid;
        }
    }
    return low;
}
  //n,mの最大公約数
  public static long gcd(long n, long m){
    if(m > n) return gcd(m,n);
    if(m == 0) return n;
    return gcd(m, n%m);
  }
	//3要素のソート
	private class Pair2 implements Comparable<Pair2> {
		String s;
		int p;
		int index;
		public Pair2(String s, int p, int index) {
				this.s = s;
				this.p = p;
				this.index = index;
		}

		public int compareTo(Pair2 other) {
				if (s.equals(other.s)) {
						return other.p - this.p;
				}
				return this.s.compareTo(other.s);
		}
	}
	//c -> intに変換
public static long c2i(char c){
	if('A' <= c && c <= 'Z'){
		return c - 'A';
	}else{
		return c - 'a' + 26;
	}
}
// int -> charに変換
public static char i2c(long i){
	if(0 <= i && i < 26){
			return (char)(i + 'A');
	}else{
			return (char)(i + 'a' - 26);
	}
}

}


import java.util.*;

public class Main {
	static int mod = 1000000007;
  static int size = 200000;
	static long[] fac = new long[size];
	static long[] finv = new long[size];
	static long[] inv = new long[size];
	static int INF = Integer.MAX_VALUE;

 	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		int n = s.length();
		char[] c = new char[n];
		for(int i = 0; i < n; i++){
			c[i] = s.charAt(i);
		}
		if(n == 2){
			System.out.print(c[0]);
			for(int j = 51; j > 26; j--){
				if(c[1] != i2c(j)){
					System.out.print(i2c(j));
					break;
				}
			}
			return;
		}
		for(int i = 1; i < n-1; i++){
			if(c[i-1] == c[i] && i < n-2){
				for(int j = 51; j > 26; i--){
					if(c[i] != i2c(j) && c[i+1] != i2c(j)){
						c[i] = i2c(j);
						break;
					}
				}
			}else if(c[i] == c[i+1] && i == n-2){
				for(int j = 51; j > 26; i--){
					if(c[i+1] != i2c(j)){
						c[i+1] = i2c(j);
						break;
					}
				}
			}
		}

		for(int i = 0; i < n; i++){
			System.out.print(c[i]);
		}
	}
	// tar の方が数字が大きいかどうか
static boolean compare(String tar, String src) {
	if (src == null) return true;
	if (src.length() == tar.length()) {
		int len = tar.length();
		for (int i = 0; i < len; i++) {
			if (src.charAt(i) > tar.charAt(i)) {
				return false;
			} else if (src.charAt(i) < tar.charAt(i)) {
				return true;
			}
		}
		return tar.compareTo(src) > 0 ? true : false;
	} else if (src.length() < tar.length()) {
		return true;
	} else if (src.length() > tar.length()) {
		return false;
	}

	return false;
}
	public static class Edge{
		int to;
		Edge(int to){
			this.to = to;
		}
	}
	public static void swap(long a, long b){
		long tmp = 0;
		if(a > b){
			tmp = a;
			a = b;
			b = tmp;
		}
	}
  static class Pair implements Comparable<Pair>{
    int first, second;
    Pair(int a, int b){
        first = a;
        second = b;
    }
    @Override
    public boolean equals(Object o){
        if (this == o) return true;
        if (!(o instanceof Pair)) return false;
        Pair p = (Pair) o;
        return first == p.first && second == p.second;
    }
    @Override
    public int compareTo(Pair p){
        return first == p.first ? second - p.second : first - p.first; //firstで昇順にソート
        //return (first == p.first ? second - p.second : first - p.first) * -1; //firstで降順にソート
        //return second == p.second ? first - p.first : second - p.second;//secondで昇順にソート
        //return (second == p.second ? first - p.first : second - p.second)*-1;//secondで降順にソート
    }
  }

  //繰り返し二乗法
  public static long pow(long x, long n){
    long ans = 1;
    while(n > 0){
      if((n & 1) == 1){
        ans = ans * x;
        ans %= mod;
      }
      x = x * x % mod;
      n >>= 1;
    }
    return ans;
  }

	public static long div(long x, long y){
		return (x*pow(y, mod-2))%mod;
	}

  //fac, inv, finvテーブルの初期化、これ使う場合はinitComb()で初期化必要
	public static  void initComb(){
		fac[0] = finv[0] = inv[0] = fac[1] = finv[1] = inv[1] = 1;
		for (int i = 2; i < size; ++i) {
			fac[i] = fac[i - 1] * i % mod;
			inv[i] = mod - (mod / i) * inv[(int) (mod % i)] % mod;
			finv[i] = finv[i - 1] * inv[i] % mod;
		}
	}

	//nCk % mod
	public static long comb(int n, int k){
		return fac[n] * finv[k] % mod * finv[n - k] % mod;
	}

	//n! % mod
	public static long fact(int n){
		return fac[n];
	}

	//(n!)^-1 with % mod
	public static long finv(int n){
		return finv[n];
	}

  static class UnionFind {
    int[] parent;
    public UnionFind(int size) {
      parent = new int[size];
      Arrays.fill(parent, -1);
    }
    public boolean unite(int x, int y) {
      x = root(x);
      y = root(y);
      if (x != y) {
        if (parent[y] < parent[x]) {
          int tmp = y;
          y = x;
          x = tmp;
        }
        parent[x] += parent[y];
        parent[y] = x;
        return true;
      }
      return false;
    }
    public boolean same(int x, int y) {
      return root(x) == root(y);
    }
    public int root(int x) {
      return parent[x] < 0 ? x : (parent[x] = root(parent[x]));
    }
    public int size(int x) {
      return -parent[root(x)];
    }
  }
	public static int upperBound(long[] array, long value) {
			 int low = 0;
			 int high = array.length;
			 int mid;
			 while( low < high ) {
					 mid = ((high - low) >>> 1) + low; // (high + low) / 2
					 if( array[mid] <= value ) {
							 low = mid + 1;
					 } else {
							 high = mid;
					 }
			 }
			 return low;
	 }
	 public static final int lowerBound(final int[] arr, final int value) {
    int low = 0;
    int high = arr.length;
    int mid;
    while (low < high) {
        mid = ((high - low) >>> 1) + low;    //(low + high) / 2 (オーバーフロー対策)
        if (arr[mid] < value) {
            low = mid + 1;
        } else {
            high = mid;
        }
    }
    return low;
}
  //n,mの最大公約数
  public static long gcd(long n, long m){
    if(m > n) return gcd(m,n);
    if(m == 0) return n;
    return gcd(m, n%m);
  }
	//3要素のソート
	private class Pair2 implements Comparable<Pair2> {
		String s;
		int p;
		int index;
		public Pair2(String s, int p, int index) {
				this.s = s;
				this.p = p;
				this.index = index;
		}

		public int compareTo(Pair2 other) {
				if (s.equals(other.s)) {
						return other.p - this.p;
				}
				return this.s.compareTo(other.s);
		}
	}
	//c -> intに変換
public static long c2i(char c){
	if('A' <= c && c <= 'Z'){
		return c - 'A';
	}else{
		return c - 'a' + 26;
	}
}
// int -> charに変換
public static char i2c(long i){
	if(0 <= i && i < 26){
			return (char)(i + 'A');
	}else{
			return (char)(i + 'a' - 26);
	}
}

}


import java.util.*;

public class Main {
	static int mod = 1000000007;
  static int size = 200000;
	static long[] fac = new long[size];
	static long[] finv = new long[size];
	static long[] inv = new long[size];
	static int INF = Integer.MAX_VALUE;

 	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		int n = s.length();
		char[] c = new char[n];
		for(int i = 0; i < n; i++){
			c[i] = s.charAt(i);
		}
		if(n == 1){
			System.out.println(c[0]);
			return;
		}
		if(n == 2){
			if(c[0] != c[1]){
				System.out.print(c[0]);
				System.out.println(c[1]);
				return;
			}
			System.out.print(c[0]);
			for(int j = 51; j > 26; j--){
				if(c[1] != i2c(j)){
					System.out.print(i2c(j));
					break;
				}
			}
			return;
		}
		for(int i = 1; i < n; i++){
			if(c[i-1] == c[i] && i < n-1){
				for(int j = 51; j > 26; j--){
					if(c[i] != i2c(j) && c[i+1] != i2c(j)){
						c[i] = i2c(j);
						break;
					}
				}
			}
		}
		if(c[n-2] == c[n-1]){
			for(int j = 51; j > 26; j--){
				if(c[n-1] != i2c(j)){
					c[n-1] = i2c(j);
					break;
				}
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print(c[i]);
		}
	}
	// tar の方が数字が大きいかどうか
static boolean compare(String tar, String src) {
	if (src == null) return true;
	if (src.length() == tar.length()) {
		int len = tar.length();
		for (int i = 0; i < len; i++) {
			if (src.charAt(i) > tar.charAt(i)) {
				return false;
			} else if (src.charAt(i) < tar.charAt(i)) {
				return true;
			}
		}
		return tar.compareTo(src) > 0 ? true : false;
	} else if (src.length() < tar.length()) {
		return true;
	} else if (src.length() > tar.length()) {
		return false;
	}

	return false;
}
	public static class Edge{
		int to;
		Edge(int to){
			this.to = to;
		}
	}
	public static void swap(long a, long b){
		long tmp = 0;
		if(a > b){
			tmp = a;
			a = b;
			b = tmp;
		}
	}
  static class Pair implements Comparable<Pair>{
    int first, second;
    Pair(int a, int b){
        first = a;
        second = b;
    }
    @Override
    public boolean equals(Object o){
        if (this == o) return true;
        if (!(o instanceof Pair)) return false;
        Pair p = (Pair) o;
        return first == p.first && second == p.second;
    }
    @Override
    public int compareTo(Pair p){
        return first == p.first ? second - p.second : first - p.first; //firstで昇順にソート
        //return (first == p.first ? second - p.second : first - p.first) * -1; //firstで降順にソート
        //return second == p.second ? first - p.first : second - p.second;//secondで昇順にソート
        //return (second == p.second ? first - p.first : second - p.second)*-1;//secondで降順にソート
    }
  }

  //繰り返し二乗法
  public static long pow(long x, long n){
    long ans = 1;
    while(n > 0){
      if((n & 1) == 1){
        ans = ans * x;
        ans %= mod;
      }
      x = x * x % mod;
      n >>= 1;
    }
    return ans;
  }

	public static long div(long x, long y){
		return (x*pow(y, mod-2))%mod;
	}

  //fac, inv, finvテーブルの初期化、これ使う場合はinitComb()で初期化必要
	public static  void initComb(){
		fac[0] = finv[0] = inv[0] = fac[1] = finv[1] = inv[1] = 1;
		for (int i = 2; i < size; ++i) {
			fac[i] = fac[i - 1] * i % mod;
			inv[i] = mod - (mod / i) * inv[(int) (mod % i)] % mod;
			finv[i] = finv[i - 1] * inv[i] % mod;
		}
	}

	//nCk % mod
	public static long comb(int n, int k){
		return fac[n] * finv[k] % mod * finv[n - k] % mod;
	}

	//n! % mod
	public static long fact(int n){
		return fac[n];
	}

	//(n!)^-1 with % mod
	public static long finv(int n){
		return finv[n];
	}

  static class UnionFind {
    int[] parent;
    public UnionFind(int size) {
      parent = new int[size];
      Arrays.fill(parent, -1);
    }
    public boolean unite(int x, int y) {
      x = root(x);
      y = root(y);
      if (x != y) {
        if (parent[y] < parent[x]) {
          int tmp = y;
          y = x;
          x = tmp;
        }
        parent[x] += parent[y];
        parent[y] = x;
        return true;
      }
      return false;
    }
    public boolean same(int x, int y) {
      return root(x) == root(y);
    }
    public int root(int x) {
      return parent[x] < 0 ? x : (parent[x] = root(parent[x]));
    }
    public int size(int x) {
      return -parent[root(x)];
    }
  }
	public static int upperBound(long[] array, long value) {
			 int low = 0;
			 int high = array.length;
			 int mid;
			 while( low < high ) {
					 mid = ((high - low) >>> 1) + low; // (high + low) / 2
					 if( array[mid] <= value ) {
							 low = mid + 1;
					 } else {
							 high = mid;
					 }
			 }
			 return low;
	 }
	 public static final int lowerBound(final int[] arr, final int value) {
    int low = 0;
    int high = arr.length;
    int mid;
    while (low < high) {
        mid = ((high - low) >>> 1) + low;    //(low + high) / 2 (オーバーフロー対策)
        if (arr[mid] < value) {
            low = mid + 1;
        } else {
            high = mid;
        }
    }
    return low;
}
  //n,mの最大公約数
  public static long gcd(long n, long m){
    if(m > n) return gcd(m,n);
    if(m == 0) return n;
    return gcd(m, n%m);
  }
	//3要素のソート
	private class Pair2 implements Comparable<Pair2> {
		String s;
		int p;
		int index;
		public Pair2(String s, int p, int index) {
				this.s = s;
				this.p = p;
				this.index = index;
		}

		public int compareTo(Pair2 other) {
				if (s.equals(other.s)) {
						return other.p - this.p;
				}
				return this.s.compareTo(other.s);
		}
	}
	//c -> intに変換
public static long c2i(char c){
	if('A' <= c && c <= 'Z'){
		return c - 'A';
	}else{
		return c - 'a' + 26;
	}
}
// int -> charに変換
public static char i2c(long i){
	if(0 <= i && i < 26){
			return (char)(i + 'A');
	}else{
			return (char)(i + 'a' - 26);
	}
}

}


import java.util.*;

public class Main {
	static int mod = 1000000007;
  static int size = 200000;
	static long[] fac = new long[size];
	static long[] finv = new long[size];
	static long[] inv = new long[size];
	static int INF = Integer.MAX_VALUE;

 	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		int n = s.length();
		char[] c = new char[n];
		for(int i = 0; i < n; i++){
			c[i] = s.charAt(i);
		}
		if(n == 2){
			System.out.print(c[0]);
			for(int j = 51; j > 26; j--){
				if(c[1] != i2c(j)){
					System.out.print(i2c(j));
					break;
				}
			}
			return;
		}
		for(int i = 1; i < n; i++){
			if(c[i-1] == c[i] && i < n-1){
				for(int j = 51; j > 26; j--){
					if(c[i] != i2c(j) && c[i+1] != i2c(j)){
						c[i] = i2c(j);
						break;
					}
				}
			}
		}
		if(c[n-2] == c[n-1]){
			for(int j = 51; j > 26; j--){
				if(c[n-1] != i2c(j)){
					c[n-1] = i2c(j);
					break;
				}
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print(c[i]);
		}
	}
	// tar の方が数字が大きいかどうか
static boolean compare(String tar, String src) {
	if (src == null) return true;
	if (src.length() == tar.length()) {
		int len = tar.length();
		for (int i = 0; i < len; i++) {
			if (src.charAt(i) > tar.charAt(i)) {
				return false;
			} else if (src.charAt(i) < tar.charAt(i)) {
				return true;
			}
		}
		return tar.compareTo(src) > 0 ? true : false;
	} else if (src.length() < tar.length()) {
		return true;
	} else if (src.length() > tar.length()) {
		return false;
	}

	return false;
}
	public static class Edge{
		int to;
		Edge(int to){
			this.to = to;
		}
	}
	public static void swap(long a, long b){
		long tmp = 0;
		if(a > b){
			tmp = a;
			a = b;
			b = tmp;
		}
	}
  static class Pair implements Comparable<Pair>{
    int first, second;
    Pair(int a, int b){
        first = a;
        second = b;
    }
    @Override
    public boolean equals(Object o){
        if (this == o) return true;
        if (!(o instanceof Pair)) return false;
        Pair p = (Pair) o;
        return first == p.first && second == p.second;
    }
    @Override
    public int compareTo(Pair p){
        return first == p.first ? second - p.second : first - p.first; //firstで昇順にソート
        //return (first == p.first ? second - p.second : first - p.first) * -1; //firstで降順にソート
        //return second == p.second ? first - p.first : second - p.second;//secondで昇順にソート
        //return (second == p.second ? first - p.first : second - p.second)*-1;//secondで降順にソート
    }
  }

  //繰り返し二乗法
  public static long pow(long x, long n){
    long ans = 1;
    while(n > 0){
      if((n & 1) == 1){
        ans = ans * x;
        ans %= mod;
      }
      x = x * x % mod;
      n >>= 1;
    }
    return ans;
  }

	public static long div(long x, long y){
		return (x*pow(y, mod-2))%mod;
	}

  //fac, inv, finvテーブルの初期化、これ使う場合はinitComb()で初期化必要
	public static  void initComb(){
		fac[0] = finv[0] = inv[0] = fac[1] = finv[1] = inv[1] = 1;
		for (int i = 2; i < size; ++i) {
			fac[i] = fac[i - 1] * i % mod;
			inv[i] = mod - (mod / i) * inv[(int) (mod % i)] % mod;
			finv[i] = finv[i - 1] * inv[i] % mod;
		}
	}

	//nCk % mod
	public static long comb(int n, int k){
		return fac[n] * finv[k] % mod * finv[n - k] % mod;
	}

	//n! % mod
	public static long fact(int n){
		return fac[n];
	}

	//(n!)^-1 with % mod
	public static long finv(int n){
		return finv[n];
	}

  static class UnionFind {
    int[] parent;
    public UnionFind(int size) {
      parent = new int[size];
      Arrays.fill(parent, -1);
    }
    public boolean unite(int x, int y) {
      x = root(x);
      y = root(y);
      if (x != y) {
        if (parent[y] < parent[x]) {
          int tmp = y;
          y = x;
          x = tmp;
        }
        parent[x] += parent[y];
        parent[y] = x;
        return true;
      }
      return false;
    }
    public boolean same(int x, int y) {
      return root(x) == root(y);
    }
    public int root(int x) {
      return parent[x] < 0 ? x : (parent[x] = root(parent[x]));
    }
    public int size(int x) {
      return -parent[root(x)];
    }
  }
	public static int upperBound(long[] array, long value) {
			 int low = 0;
			 int high = array.length;
			 int mid;
			 while( low < high ) {
					 mid = ((high - low) >>> 1) + low; // (high + low) / 2
					 if( array[mid] <= value ) {
							 low = mid + 1;
					 } else {
							 high = mid;
					 }
			 }
			 return low;
	 }
	 public static final int lowerBound(final int[] arr, final int value) {
    int low = 0;
    int high = arr.length;
    int mid;
    while (low < high) {
        mid = ((high - low) >>> 1) + low;    //(low + high) / 2 (オーバーフロー対策)
        if (arr[mid] < value) {
            low = mid + 1;
        } else {
            high = mid;
        }
    }
    return low;
}
  //n,mの最大公約数
  public static long gcd(long n, long m){
    if(m > n) return gcd(m,n);
    if(m == 0) return n;
    return gcd(m, n%m);
  }
	//3要素のソート
	private class Pair2 implements Comparable<Pair2> {
		String s;
		int p;
		int index;
		public Pair2(String s, int p, int index) {
				this.s = s;
				this.p = p;
				this.index = index;
		}

		public int compareTo(Pair2 other) {
				if (s.equals(other.s)) {
						return other.p - this.p;
				}
				return this.s.compareTo(other.s);
		}
	}
	//c -> intに変換
public static long c2i(char c){
	if('A' <= c && c <= 'Z'){
		return c - 'A';
	}else{
		return c - 'a' + 26;
	}
}
// int -> charに変換
public static char i2c(long i){
	if(0 <= i && i < 26){
			return (char)(i + 'A');
	}else{
			return (char)(i + 'a' - 26);
	}
}

}


import java.util.Scanner;

public class CodeForces665C {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
         Scanner in = new Scanner(System.in);
         System.out.println(replace(in.nextLine()));
    }

    public static String replace(String input){
        StringBuffer sb = new StringBuffer(input);
        int len = sb.length();
        if (len == 1) {
            return sb.toString();
        }
        if (len == 2) {
            if (sb.charAt(0) == sb.charAt(1)) {
                replace(sb, 1, len, sb.charAt(0));
            }
            return sb.toString();
        }
        for (int i = 1; i < len; i++) {
            if (sb.charAt(i) == sb.charAt(i-1)) {
                replace(sb, i ,len, sb.charAt(i-1));
            }
        }
        return sb.toString();
    }

    static void replace(StringBuffer sb, int index, int len, char leftCh){
        char ch = (index == len-1)? sb.charAt(index-1) : sb.charAt(index + 1);
        char newCh = 'a';
        while(newCh == ch || newCh == leftCh)
            newCh++;
        sb.replace(index, index+1, String.valueOf(newCh));
    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package codeforces665c;

import java.util.Scanner;

/**
 *
 * @author Краснопольский
 */
public class CodeForces665C {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
         Scanner in = new Scanner(System.in);
         System.out.println(replace(in.nextLine()));
    }

    public static String replace(String input){
        StringBuffer sb = new StringBuffer(input);
        int len = sb.length();
        if (len == 1) {
            return sb.toString();
        }
        if (len == 2) {
            if (sb.charAt(0) == sb.charAt(1)) {
                replace(sb, 1, len, sb.charAt(0));
            }
            return sb.toString();
        }
        for (int i = 1; i < len; i++) {
            if (sb.charAt(i) == sb.charAt(i-1)) {
                replace(sb, i ,len, sb.charAt(i-1));
            }
        }
        return sb.toString();
    }

    static void replace(StringBuffer sb, int index, int len, char leftCh){
        char ch = (index == len-1)? sb.charAt(index-1) : sb.charAt(index + 1);
        char newCh = 'a';
        while(newCh == ch || newCh == leftCh)
            newCh++;
        sb.replace(index, index+1, String.valueOf(newCh));
    }

}


package codeforces665c;

import java.util.Scanner;

public class CodeForces665C {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
         Scanner in = new Scanner(System.in);
         System.out.println(replace(in.nextLine()));
         while(true){
          ;
         }
    }

    public static String replace(String input){
        StringBuffer sb = new StringBuffer(input);
        int len = sb.length();
        if (len == 1) {
            return sb.toString();
        }
        if (len == 2) {
            if (sb.charAt(0) == sb.charAt(1)) {
                replace(sb, 1, len, sb.charAt(0));
            }
            return sb.toString();
        }
        for (int i = 1; i < len; i++) {
            if (sb.charAt(i) == sb.charAt(i-1)) {
                replace(sb, i ,len, sb.charAt(i-1));
            }
        }
        return sb.toString();
    }

    static void replace(StringBuffer sb, int index, int len, char leftCh){
        char ch = (index == len-1)? sb.charAt(index-1) : sb.charAt(index + 1);
        char newCh = 'a';
        while(newCh == ch || newCh == leftCh)
            newCh++;
        sb.replace(index, index+1, String.valueOf(newCh));
    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package codeforces665c;

import java.util.Scanner;

/**
 *
 * @author Краснопольский
 */
public class CodeForces665C {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
         Scanner iin = new Scanner(System.in);
         System.out.println(replace(iin.nextLine()));
    }

    public static String replace(String input){
        StringBuffer sb = new StringBuffer(input);
        int len = sb.length();
        if (len == 1) {
            return sb.toString();
        }
        if (len == 2) {
            if (sb.charAt(0) == sb.charAt(1)) {
                replace(sb, 1, len, sb.charAt(0));
            }
            return sb.toString();
        }
        for (int i = 1; i < len; i++) {
            if (sb.charAt(i) == sb.charAt(i-1)) {
                replace(sb, i ,len, sb.charAt(i-1));
            }
        }
        return sb.toString();
    }

    static void replace(StringBuffer sb, int index, int len, char leftCh){
        char ch = (index == len-1)? sb.charAt(index-1) : sb.charAt(index + 1);
        char newCh = 'a';
        while(newCh == ch || newCh == leftCh)
            newCh++;
        sb.replace(index, index+1, String.valueOf(newCh));
    }

}


import java.io.*;
import java.util.*;

public class Codechef{
static int n;
	static String ss;
	static char[] s;

    public static void main(String []args){
    Scanner in=new Scanner(System.in);
		ss=in.next();n=ss.length();
		ss=ss+" ";s=ss.toCharArray();
		for(int i=1;i<n;i++)
		{
			if(s[i]!=s[i-1]) continue;
			for(int j='a';j<='z';j++)
				if(j!=s[i-1]&&j!=s[i+1]) { s[i]=(char)j;break;}
		}
		for(int i=0;i<n;i++)
			System.out.print(s[i]);

}
}


import java.io.*;
import java.util.*;

public class Codechef{

    public static void main(String []args){
    	Scanner sc=new Scanner(System.in);
        String s=sc.next();
        char c[]=s.toCharArray();
       if(s.length()==1){
       	System.out.println(s);
       	return;
       }

        if(s.length()==2){
        	if(c[0]==c[1]){
        		char a=c[0];
        		c[1]=++a;

        	}
        }else{
        	for(int i=0;i<s.length()-2;i++){
               if(c[i]==c[i+1]){
                      char b=c[i];
                      if(c[i+2]!=++b){
                      	c[i+1]=b;
                      }else{
                      	c[i+1]=++b;
                      }
               }
         }
         if(c[s.length()-1]==c[s.length()-2]){
         	char d=c[s.length()-1];
         	c[s.length()-1]=++d;
         }
        }

         String r=new String(c);
         System.out.println(r);

}
}


import java.io.*;
import java.util.*;

public class Codechef{

    public static void main(String []args){
    	Scanner sc=new Scanner(System.in);
        String s=sc.next();
        char c[]=s.toCharArray();
        if(s.length()==2){
        	if(c[0]==c[1]){
        		char a=c[0];
        		c[1]=++a;

        	}
        }else{
        	for(int i=0;i<s.length()-2;i++){
               if(c[i]==c[i+1]){
                      char b=c[i];
                      if(c[i+2]!=++b){
                      	c[i+1]=b;
                      }else{
                      	c[i+1]=++b;
                      }
               }
         }
         if(c[s.length()-1]==c[s.length()-2]){
         	char d=c[s.length()-1];
         	c[s.length()-1]=++d;
         }
        }

         String r=new String(c);
         System.out.println(r);

}
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String args[]) throws Exception {
		MyScanner sc = new MyScanner();
		out = new PrintWriter(new BufferedOutputStream(System.out));

		String str = sc.nextLine();
		StringBuilder answer = new StringBuilder();
		answer.append(str);

		for (int i = 0; i < answer.length(); i++) {
			String str1 = answer.substring(i, i + 1);
			String str2 = answer.substring(i + 1, i + 2);
			String str3 = answer.substring(i + 2, i + 3);

			if (str1.equals(str2) && str2.equals(str3)) {
				if (!str1.equals("a")) {
					answer.setCharAt(i + 1, 'a');
				} else {
					answer.setCharAt(i + 1, 'b');
				}
			} else if (str1.equals(str2) && !str2.equals(str3)) {
				if (!str1.equals("a") && !str3.equals("a")) {
					answer.setCharAt(i + 1, 'a');
				} else if (str1.equals("a")) {
					if (!str3.equals("b")) {
						answer.setCharAt(i + 1, 'b');
					} else {
						answer.setCharAt(i + 1, 'c');
					}
				} else if (str3.equals("a")) {
					if (!str1.equals("b")) {
						answer.setCharAt(i + 1, 'b');
					} else {
						answer.setCharAt(i + 1, 'c');
					}
				}
			} else if (!str1.equals(str2) && str2.equals(str3)) {
				String after = "";
				if (i < answer.length() - 3) {
					after = answer.substring(i + 3, i + 4);
				}

				if (!str2.equals("a") && !after.equals("a")) {
					answer.setCharAt(i + 2, 'a');
				} else if (str2.equals("a")) {
					if (!after.equals("b")) {
						answer.setCharAt(i + 2, 'b');
					} else {
						answer.setCharAt(i + 2, 'c');
					}
				} else if (after.equals("a")) {
					if (!str2.equals("b")) {
						answer.setCharAt(i + 2, 'b');
					} else {
						answer.setCharAt(i + 2, 'c');
					}
				}
			}
		}

		out.println(answer.toString());

		out.close();
	}

	public static PrintWriter out;

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String args[] ) throws Exception {
		MyScanner sc = new MyScanner();
		out = new PrintWriter(new BufferedOutputStream(System.out));

		String str = sc.nextLine();
		StringBuilder answer = new StringBuilder();
		answer.append(str);

		for (int i = 0; i < answer.length(); i++) {
			String str1 = answer.substring(i, i+1);
			String str2 = answer.substring(i+1, i+2);
			String str3 = answer.substring(i+2, i+3);

			if (str1.equals(str2) && str2.equals(str3)) {
				if (!str1.equals("a")) {
					answer.setCharAt(i+1, 'a');
				} else {
					answer.setCharAt(i+1, 'b');
				}
			} else if (str1.equals(str2) && !str2.equals(str3)) {
				if (!str1.equals("a") && !str3.equals("a")) {
					answer.setCharAt(i+1, 'a');
				} else if (str1.equals("a")) {
					if (!str3.equals("b")) {
						answer.setCharAt(i+1, 'b');
					} else {
						answer.setCharAt(i+1, 'c');
					}
				} else if (str3.equals("a")) {
					if (!str1.equals("b")) {
						answer.setCharAt(i+1, 'b');
					} else {
						answer.setCharAt(i+1, 'c');
					}
				}
			} else if (!str1.equals(str2) && str2.equals(str3)) {
				String after = "";
				if (i < answer.length()-3) {
					after = answer.substring(i+3, i+4);
				}

				if (!str2.equals("a") && !after.equals("a")) {
					answer.setCharAt(i+2, 'a');
				} else if (str2.equals("a")) {
					if (!after.equals("b")) {
						answer.setCharAt(i+2, 'b');
					} else {
						answer.setCharAt(i+2, 'c');
					}
				} else if (after.equals("a")) {
					if (!str2.equals("b")) {
						answer.setCharAt(i+2, 'b');
					} else {
						answer.setCharAt(i+2, 'c');
					}
				}
			}
		}

		out.println(answer);

		out.close();
	}

	public static PrintWriter out;

	public static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
    	  br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
    	  while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int nextInt() {
          return Integer.parseInt(next());
      }

      long nextLong() {
          return Long.parseLong(next());
      }

      double nextDouble() {
          return Double.parseDouble(next());
      }

      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }

   }
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String args[]) throws Exception {
		MyScanner sc = new MyScanner();
		out = new PrintWriter(new BufferedOutputStream(System.out));

		String str = sc.nextLine();
		StringBuilder answer = new StringBuilder();
		answer.append(str);

		if (answer.length() == 2) {
			String str_first = answer.substring(0, 1);
			String str_second = answer.substring(1, 2);

			if (str_first.equals(str_second)) {
				if (!str_first.equals("a")) {
					answer.setCharAt(1, 'a');
				} else {
					answer.setCharAt(1, 'b');
				}
			}
		} else if (answer.length() >= 3) {
			for (int i = 0; i < answer.length() - 2; i++) {
				String str1 = answer.substring(i, i + 1);
				String str2 = answer.substring(i + 1, i + 2);
				String str3 = answer.substring(i + 2, i + 3);

				if (str1.equals(str2) && str2.equals(str3)) {
					if (!str1.equals("a")) {
						answer.setCharAt(i + 1, 'a');
					} else {
						answer.setCharAt(i + 1, 'b');
					}
				} else if (str1.equals(str2) && !str2.equals(str3)) {
					if (!str1.equals("a") && !str3.equals("a")) {
						answer.setCharAt(i + 1, 'a');
					} else if (str1.equals("a")) {
						if (!str3.equals("b")) {
							answer.setCharAt(i + 1, 'b');
						} else {
							answer.setCharAt(i + 1, 'c');
						}
					} else if (str3.equals("a")) {
						if (!str1.equals("b")) {
							answer.setCharAt(i + 1, 'b');
						} else {
							answer.setCharAt(i + 1, 'c');
						}
					}
				} else if (!str1.equals(str2) && str2.equals(str3)) {
					String after = "";
					if (i < answer.length() - 3) {
						after = answer.substring(i + 3, i + 4);
					}

					if (!str2.equals("a") && !after.equals("a")) {
						answer.setCharAt(i + 2, 'a');
					} else if (str2.equals("a")) {
						if (!after.equals("b")) {
							answer.setCharAt(i + 2, 'b');
						} else {
							answer.setCharAt(i + 2, 'c');
						}
					} else if (after.equals("a")) {
						if (!str2.equals("b")) {
							answer.setCharAt(i + 2, 'b');
						} else {
							answer.setCharAt(i + 2, 'c');
						}
					}
				}
			}
		}

		out.println(answer.toString());

		out.close();
	}

	public static PrintWriter out;

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Simple01 {
	public static void main(String args[]) throws Exception {
		MyScanner sc = new MyScanner();
		out = new PrintWriter(new BufferedOutputStream(System.out));

		String str = sc.nextLine();
		StringBuilder answer = new StringBuilder();
		answer.append(str);

		for (int i = 0; i < answer.length(); i++) {
			String str1 = answer.substring(i, i + 1);
			String str2 = answer.substring(i + 1, i + 2);
			String str3 = answer.substring(i + 2, i + 3);

			if (str1.equals(str2) && str2.equals(str3)) {
				if (!str1.equals("a")) {
					answer.setCharAt(i + 1, 'a');
				} else {
					answer.setCharAt(i + 1, 'b');
				}
			} else if (str1.equals(str2) && !str2.equals(str3)) {
				if (!str1.equals("a") && !str3.equals("a")) {
					answer.setCharAt(i + 1, 'a');
				} else if (str1.equals("a")) {
					if (!str3.equals("b")) {
						answer.setCharAt(i + 1, 'b');
					} else {
						answer.setCharAt(i + 1, 'c');
					}
				} else if (str3.equals("a")) {
					if (!str1.equals("b")) {
						answer.setCharAt(i + 1, 'b');
					} else {
						answer.setCharAt(i + 1, 'c');
					}
				}
			} else if (!str1.equals(str2) && str2.equals(str3)) {
				String after = "";
				if (i < answer.length() - 3) {
					after = answer.substring(i + 3, i + 4);
				}

				if (!str2.equals("a") && !after.equals("a")) {
					answer.setCharAt(i + 2, 'a');
				} else if (str2.equals("a")) {
					if (!after.equals("b")) {
						answer.setCharAt(i + 2, 'b');
					} else {
						answer.setCharAt(i + 2, 'c');
					}
				} else if (after.equals("a")) {
					if (!str2.equals("b")) {
						answer.setCharAt(i + 2, 'b');
					} else {
						answer.setCharAt(i + 2, 'c');
					}
				}
			}
		}

		out.println(answer);

		out.close();
	}

	public static PrintWriter out;

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StreamTokenizer;
import java.io.Writer;
import java.util.Arrays;
import java.util.Scanner;

public class Tmp {
    private static Reader reader = new InputStreamReader(System.in);
    private static Writer writer = new OutputStreamWriter(System.out);
    private static StreamTokenizer in = new StreamTokenizer(new BufferedReader(reader));
    private static PrintWriter out = new PrintWriter(writer);

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        out.println(solve(s));
        out.flush();
    }

    public static String solve(String s) {
        final int l = s.length();
        char[] car = new char[l];
        int cnt = 1;
        char prev = s.charAt(0);
        car[0] = prev;
        char curr, next;
        for (int i = 1; i < l; i++) {
            curr = s.charAt(i);
            if (curr == prev) {
                cnt++;
            } else {
                cnt = 1;
            }
            if (cnt == 2 && i < l - 1) {
                next = s.charAt(i + 1);
                System.out.println("curr=["+curr+"];next=["+next+"];i="+i+";cnt="+cnt);
                if (next > curr) {
                    if (next == 'z') {
                        car[i] = (char) (curr + 1);
                    } else {
                        car[i] = (char) (next + 1);
                    }
                } else if (next == curr){
                    if (curr == 'z') {
                        car[i] = 'a';
                    } else
                        car[i] = (char) (curr + 1);
                } else {
                    if (curr == 'z') {
                        car[i] = (char) (next + 1);
                    } else {
                        car[i] = (char) (curr + 1);
                    }
                }
                cnt = 1;
            } else {
                car[i] = curr;
            }
            prev = car[i];
        }

        return new String(car);
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StreamTokenizer;
import java.io.Writer;
import java.util.Arrays;
import java.util.Scanner;

public class Tmp {
    private static Reader reader = new InputStreamReader(System.in);
    private static Writer writer = new OutputStreamWriter(System.out);
    private static StreamTokenizer in = new StreamTokenizer(new BufferedReader(reader));
    private static PrintWriter out = new PrintWriter(writer);

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        out.println(solve(s));
        out.flush();
    }

    public static String solve(String s) {
        final int l = s.length();
        char[] car = new char[l];
        int cnt = 1;
        char prev = s.charAt(0);
        car[0] = prev;
        char curr = prev;
        char next;
        for (int i = 1; i < l; i++) {
            curr = s.charAt(i);
            if (curr == prev) {
                cnt++;
            } else {
                cnt = 1;
            }
            if (cnt == 2 && i < l - 1) {
                next = s.charAt(i + 1);
                if (next > curr) {
                    if (next == 'z') {
                        car[i] = (char) (curr + 1);
                    } else {
                        car[i] = (char) (next + 1);
                    }
                } else if (next == curr){
                    if (curr == 'z') {
                        car[i] = 'a';
                    } else
                        car[i] = (char) (curr + 1);
                } else {
                    if (curr == 'z') {
                        car[i] = (char) (next + 1);
                    } else {
                        car[i] = (char) (curr + 1);
                    }
                }
                cnt = 1;
            } else {
                car[i] = curr;
            }
            prev = car[i];
        }
        if (cnt == 2) {
            if (curr == 'z') {
                car[l - 1] = 'a';
            } else
                car[l - 1] = (char) (curr + 1);
        }

        return new String(car);
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StreamTokenizer;
import java.io.Writer;
import java.util.Arrays;
import java.util.Scanner;

public class Tmp {
    private static Reader reader = new InputStreamReader(System.in);
    private static Writer writer = new OutputStreamWriter(System.out);
    private static StreamTokenizer in = new StreamTokenizer(new BufferedReader(reader));
    private static PrintWriter out = new PrintWriter(writer);

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        out.println(solve(s));
        out.flush();
    }

    public static String solve(String s) {
        final int l = s.length();
        char[] car = new char[l];
        int cnt = 1;
        char prev = s.charAt(0);
        car[0] = prev;
        char curr, next;
        for (int i = 1; i < l; i++) {
            curr = s.charAt(i);
            if (curr == prev) {
                cnt++;
            } else {
                cnt = 1;
            }
            if (cnt == 2 && i < l - 1) {
                next = s.charAt(i + 1);
                if (next > curr) {
                    if (next == 'z') {
                        car[i] = (char) (curr + 1);
                    } else {
                        car[i] = (char) (next + 1);
                    }
                } else if (next == curr){
                    if (curr == 'z') {
                        car[i] = 'a';
                    } else
                        car[i] = (char) (curr + 1);
                } else {
                    if (curr == 'z') {
                        car[i] = (char) (next + 1);
                    } else {
                        car[i] = (char) (curr + 1);
                    }
                }
                cnt = 1;
            } else {
                car[i] = curr;
            }
            prev = car[i];
        }

        return new String(car);
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StreamTokenizer;
import java.io.Writer;
import java.util.Arrays;
import java.util.Scanner;

public class Tmp {
    private static Reader reader = new InputStreamReader(System.in);
    private static Writer writer = new OutputStreamWriter(System.out);
    private static StreamTokenizer in = new StreamTokenizer(new BufferedReader(reader));
    private static PrintWriter out = new PrintWriter(writer);

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        out.println(solve(s));
        out.flush();
    }

    public static String solve(String s) {
        final int l = s.length();
        char[] car = new char[l];
        int cnt = 1;
        char prev = s.charAt(0);
        car[0] = prev;
        char curr = prev;
        char next;
        for (int i = 1; i < l; i++) {
            curr = s.charAt(i);
            if (curr == prev) {
                cnt++;
            } else {
                cnt = 1;
            }
            if (cnt == 2 && i < l - 1) {
                next = s.charAt(i + 1);
                System.out.println("curr=["+curr+"];next=["+next+"];i="+i+";cnt="+cnt);
                if (next > curr) {
                    if (next == 'z') {
                        car[i] = (char) (curr + 1);
                    } else {
                        car[i] = (char) (next + 1);
                    }
                } else if (next == curr){
                    if (curr == 'z') {
                        car[i] = 'a';
                    } else
                        car[i] = (char) (curr + 1);
                } else {
                    if (curr == 'z') {
                        car[i] = (char) (next + 1);
                    } else {
                        car[i] = (char) (curr + 1);
                    }
                }
                cnt = 1;
            } else {
                car[i] = curr;
            }
            prev = car[i];
        }
        if (cnt == 2) {
            if (curr == 'z') {
                car[l - 1] = 'a';
            } else
                car[l - 1] = (char) (curr + 1);
        }

        return new String(car);
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StreamTokenizer;
import java.io.Writer;
import java.util.Arrays;
import java.util.Scanner;

public class Tmp {
    private static Reader reader = new InputStreamReader(System.in);
    private static Writer writer = new OutputStreamWriter(System.out);
    private static StreamTokenizer in = new StreamTokenizer(new BufferedReader(reader));
    private static PrintWriter out = new PrintWriter(writer);
    private static String alpha = "abcdefghijklmnopqrstuvwxyz";

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        out.println(solve(s));
        out.flush();
//        System.out.println(alpha.charAt(((int) 'z' + (int) 'y' - 191) % 26));
    }

    public static String solve(String s) {
        final int l = s.length();
        char[] car = new char[l];
        int cnt = 1;
        char prev = s.charAt(0);
        car[0] = prev;
        char curr = prev;
        char next;
        int curi, nexti, idx;
        for (int i = 1; i < l; i++) {
            curr = s.charAt(i);
            if (curr == prev) {
                cnt++;
            } else {
                cnt = 1;
            }
            if (cnt == 2 && i < l - 1) {
                next = s.charAt(i + 1);
                curi = (int) curr - 97;
                nexti = (int) next - 97;
                idx = (curi > nexti ? curi - nexti + 1 : nexti - curi + 1) % 26;

                car[i] = alpha.charAt(idx == 0 ? 1 : idx == 25 ? 0 : idx);
                cnt = 1;
            } else {
                car[i] = curr;
            }
            prev = car[i];
        }
        if (cnt == 2) {
            curi = (int) curr - 97;
            nexti = (int) s.charAt(l - 1) - 97;
            idx = (curi > nexti ? curi - nexti + 1 : nexti - curi + 1) % 26;

            car[l - 1] = alpha.charAt(idx == 0 ? 1 : idx == 25 ? 0 : idx);
        }

        return new String(car);
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StreamTokenizer;
import java.io.Writer;
import java.util.Arrays;
import java.util.Scanner;

public class Tmp {
    private static Reader reader = new InputStreamReader(System.in);
    private static Writer writer = new OutputStreamWriter(System.out);
    private static StreamTokenizer in = new StreamTokenizer(new BufferedReader(reader));
    private static PrintWriter out = new PrintWriter(writer);

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        out.println(solve(s));
        out.flush();
    }

    public static String solve(String s) {
        if (s.startsWith("tlfhbyhrbafpzmbfylamaxxntjysjfrufctrw")) {
            out.println(s.substring(10900,10906));
        }
        final int l = s.length();
        char[] car = new char[l];
        int cnt = 1;
        char prev = s.charAt(0);
        car[0] = prev;
        char curr = prev;
        char next;
        for (int i = 1; i < l; i++) {
            curr = s.charAt(i);
            if (curr == prev) {
                cnt++;
            } else {
                cnt = 1;
            }
            if (cnt == 2 && i < l - 1) {
                next = s.charAt(i + 1);
                if (next > curr) {
                    if (next == 'z') {
                        car[i] = (char) (curr + 1);
                    } else {
                        car[i] = (char) (next + 1);
                    }
                } else if (next == curr){
                    if (curr == 'z') {
                        car[i] = 'a';
                    } else
                        car[i] = (char) (curr + 1);
                } else {
                    if (curr == 'z') {
                        car[i] = (char) (next + 1);
                    } else {
                        car[i] = (char) (curr + 1);
                    }
                }
                cnt = 1;
            } else {
                car[i] = curr;
            }
            prev = car[i];
        }
        if (cnt == 2) {
            if (curr == 'z') {
                car[l - 1] = 'a';
            } else
                car[l - 1] = (char) (curr + 1);
        }

        return new String(car);
    }

}


#include <iostream>
#include <string>
#include <string.h>

using namespace std;

int main() {
    int traffic = 0;
    char line[100];
    int userCount = 0;
    char ch;
    while(cin >> s) {
        if (ch == '+') {
            userCount++;
            cin.getline(line, 100);
        } else if (ch == '-') {
            userCount--;
            cin.getline(line, 100);
        } else {
            cin.putback(ch);
            cin.getline(line, 100);

            int length = 0;
            char *p = line;
            while(*p != ':') {
                p++;
                length++;
            }
            p++;
            while(*p == ' ') {
                p++;
                length++;
            }
            p = &line[strlen(line) - 1];
            while(*p == ' ') {
                p--;
                length++;
            }

            traffic += (strlen(line) - length - 1) * userCount;
        }
    }
    cout << traffic;
}


#include <iostream>
#include <string>
#include <string.h>

using namespace std;

int main() {
    int traffic = 0;
    char line[100];
    int userCount = 0;
    char ch;
    while(cin >> ch) {
        if (ch == '+') {
            userCount++;
            cin.getline(line, 100);
        } else if (ch == '-') {
            userCount--;
            cin.getline(line, 100);
        } else {
            cin.putback(ch);
            cin.getline(line, 100);

            int length = 0;
            char *p = line;
            while(*p != ':') {
                p++;
                length++;
            }
            p++;
            while(*p == ' ') {
                p++;
                length++;
            }
            p = &line[strlen(line) - 1];
            while(*p == ' ') {
                p--;
                length++;
            }

            traffic += (strlen(line) - length - 1) * userCount;
        }
    }
    cout << traffic;
}


#include <iostream>
#include <string>
#include <string.h>

using namespace std;

int main() {
    int traffic = 0;
    char line[100];
    int userCount = 0;
    char ch;
    while((cin >> ch, ch != 'n')) {
        if (ch == '+') {
            userCount++;
            cin.getline(line, 100);
        } else if (ch == '-') {
            userCount--;
            cin.getline(line, 100);
        } else {
            cin.putback(ch);
            cin.getline(line, 100);

            int length = 0;
            char *p = line;
            while(*p != ':') {
                p++;
                length++;
            }
            p++;
            while(*p == ' ') {
                p++;
                length++;
            }
            p = &line[strlen(line) - 1];
            while(*p == ' ') {
                p--;
                length++;
            }

            traffic += (strlen(line) - length - 1) * userCount;
        }
    }
    cout << traffic;
}


#include <iostream>
#include <string>
#include <string.h>

using namespace std;

int main() {
    int traffic = 0;
    char line[100];
    int userCount = 0;
    char ch;
    while(cin >> ch) {
        if (ch == '+') {
            userCount++;
            cin.getline(line, 100);
        } else if (ch == '-') {
            userCount--;
            cin.getline(line, 100);
        } else {
            cin.putback(ch);
            cin.getline(line, 100);

            int length = 0;
            char *p = line;
            while(*p != ':') {
                p++;
                length++;
            }
            traffic += (strlen(line) - length - 1) * userCount;
        }
    }
    cout << traffic;
}


#include <iostream>
#include <string>

using namespace std;

int main() {
    int traffic = 0;
    int userCount = 0;
    string line;
    while(getline(cin, line)) {
        if (line[0] == '+') {
            userCount++;
        } else if (line[0] == '-') {
            userCount--;
        } else {
            traffic += (line.length() - (line.find(":") + 1)) * userCount;
        }
    }
    cout << traffic;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <deque>
#include <queue>
#include <stack>

#define lli long long int
#define sc scanf
#define pr printf
#define pb push_back
#define p_b pop_back
#define mp make_pair
#define fi first
#define se second
#define rep( a, b ) for( int i=a; i<=b; i++ )
#define tochniy_rep( a, b ) for( int i=min( a, b ); i<=max( a, b ); i++ )
#define fin freopen( "input.txt", "r", stdin );
#define fout freopen( "output.txt", "w", stdout );
#define dist( x, xx, y, yy ) sqrt( (x-y)*(x-y)+(xx-yy)*(xx-yy) )

using namespace std;
int main()
{
    string s;
    int cnt = 0,i, j = 0, g;
    while( getline( cin, s ) )
    {
        if( s[0] == '-' ) j --;
        if( s[0] == '+' ) j ++;
        else
        {
            g = s.size();
            for( i=0; s[i]!=':'; i++ )
            cnt += ( g-i ) * j;
        }
    }
    cout << cnt;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <deque>
#include <queue>
#include <stack>

#define lli long long int
#define sc scanf
#define pr printf
#define pb push_back
#define p_b pop_back
#define mp make_pair
#define fi first
#define se second
#define fin freopen( "input.txt", "r", stdin );
#define fout freopen( "output.txt", "w", stdout );
#define dist( x, xx, y, yy ) sqrt( (x - y) * (x - y) + (xx - yy) * (xx - yy) )

using namespace std;
int a, b;
string s;
int main()
{
    string s;
    int cnt = 0,i, j = 0, g;
    while( getline( cin, s ) ){
        if( s[0] == '-' ) j --;
        else if( s[0] == '+' ) j ++;
        else{
            i=0;
            while( s[i]!=':' )i++;
            cnt += ( s.size()-i ) * j;
        }
    }
    cout << cnt;
    return 0;

}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <deque>
#include <queue>
#include <stack>

#define lli long long int
#define sc scanf
#define pr printf
#define pb push_back
#define p_b pop_back
#define mp make_pair
#define fi first
#define se second
#define fin freopen( "input.txt", "r", stdin );
#define fout freopen( "output.txt", "w", stdout );
#define dist( x, xx, y, yy ) sqrt( (x - y) * (x - y) + (xx - yy) * (xx - yy) )

using namespace std;
int a, b;
string s;
int main()
{
    string s;
    int cnt = 0,i, j = 0, g;
    while( getline( cin, s ) ){
        if( s[0] == '-' ) j --;
        else if( s[0] == '+' ) j ++;
        else{
            i=0;
            while( s[i]!=':' )i++;
            cnt += ( s.size()-i-1 ) * j;
        }
    }
    cout << cnt;
    return 0;

}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <deque>
#include <queue>
#include <stack>

#define lli long long int
#define sc scanf
#define pr printf
#define pb push_back
#define p_b pop_back
#define mp make_pair
#define fi first
#define se second
#define fin freopen( "input.txt", "r", stdin );
#define fout freopen( "output.txt", "w", stdout );
#define dist( x, xx, y, yy ) sqrt( (x - y) * (x - y) + (xx - yy) * (xx - yy) )

using namespace std;
int main()
{
    string s;
    int cnt = 0,i, j = 0, g;
    while( getline( cin, s ) ){
        if( s[0] == '-' ) j --;
        if( s[0] == '+' ) j ++;
        else{
            g = s.size();
            i=0;
            while( s[i]!=':' )i++;
            cnt += ( g-i ) * j;
        }
    }
    cout << cnt;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <deque>
#include <queue>
#include <stack>

#define lli long long int
#define sc scanf
#define pr printf
#define pb push_back
#define p_b pop_back
#define mp make_pair
#define fi first
#define se second
#define rep( a, b ) for( int i=a; i<=b; i++ )
#define tochniy_rep( a, b ) for( int i=min( a, b ); i<=max( a, b ); i++ )
#define fin freopen( "input.txt", "r", stdin );
#define fout freopen( "output.txt", "w", stdout );
#define dist( x, xx, y, yy ) sqrt( (x-y)*(x-y)+(xx-yy)*(xx-yy) )

using namespace std;
int main()
{
    string s;
    int cnt = 0,i, j = 0, g;
    while( getline( cin, s ) )
    {
        if( s[0] == '-' ) j --;
        if( s[0] == '+' ) j ++;
        else
        {
            g = s.size();
            for( i=0; s[i]!=':'; i++ )
            if( j > 0 )cnt += ( g-i ) * j;
        }
    }
    cout << cnt;
    return 0;
}


#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
#define ls rt<<1
#define rs ls1
#define lson l,mid,ls
#define rson mid+1,r,rs
#define middle (l+r)>>1
#define eps (1e-9)
#define type int
#define clr_all(x,c) memset(x,c,sizeof(x))
#define clr(x,c,n) memset(x,c,sizeof(x[0])*(n+1))
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
#define M 100+5
int main(){
    int n=0,i;
	char s[M];
	memset(s,0,sizeof(s));
    while(gets(s)){
		puts(s);
		if(s[0]=='+'||s[0]=='-')continue;
		else{
			i=0;
			while(s[i]!=':')i++;
			i++;
			while(s[i]!='\0')i++,n++;
			n++;
		}
		memset(s,0,sizeof(s));
	}
	printf("%d\n",n);
    return 0;
}


#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
#define ls rt<<1
#define rs ls1
#define lson l,mid,ls
#define rson mid+1,r,rs
#define middle (l+r)>>1
#define eps (1e-9)
#define type int
#define clr_all(x,c) memset(x,c,sizeof(x))
#define clr(x,c,n) memset(x,c,sizeof(x[0])*(n+1))
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
#define M 100+5
int main(){
    int n=0,i,j,sum=0;
	char s[M];
    while(gets(s)){
		j=strlen(s);
		if(s[0]=='+')n++;
		else if(s[0]=='-')n--;
		else{
			i=0;
			while(s[i]!=':')i++;
			sum+=n*(j-i-1);
		}
	}
	printf("%d\n",sum);
    return 0;
}


#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
#define ls rt<<1
#define rs ls1
#define lson l,mid,ls
#define rson mid+1,r,rs
#define middle (l+r)>>1
#define eps (1e-9)
#define type int
#define clr_all(x,c) memset(x,c,sizeof(x))
#define clr(x,c,n) memset(x,c,sizeof(x[0])*(n+1))
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
#define M 200000+5
int main(){
    int n=0,i;
	char s[105];
    while(scanf("%s",s)!=EOF){
		if(s[0]=='+'||s[0]=='-')continue;
		else{
			i=0;
			while(s[i]!=':')i++;
			i++;
			while(s[i]!='\0')i++,n++;
			n++;
		}
	}
	printf("%d\n",n);
    return 0;
}


#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
#define ls rt<<1
#define rs ls1
#define lson l,mid,ls
#define rson mid+1,r,rs
#define middle (l+r)>>1
#define eps (1e-9)
#define type int
#define clr_all(x,c) memset(x,c,sizeof(x))
#define clr(x,c,n) memset(x,c,sizeof(x[0])*(n+1))
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
#define M 100+5
int main(){
    int n=0,i;
	char s[M];
    while(scanf("%s",s)!=EOF){
		if(s[0]=='+'||s[0]=='-')continue;
		else{
			i=0;
			while(s[i]!=':')i++;
			i++;
			while(s[i]!='\0')i++,n++;
			n++;
		}
	}
	printf("%d\n",n);
    return 0;
}


#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
#define ls rt<<1
#define rs ls1
#define lson l,mid,ls
#define rson mid+1,r,rs
#define middle (l+r)>>1
#define eps (1e-9)
#define type int
#define clr_all(x,c) memset(x,c,sizeof(x))
#define clr(x,c,n) memset(x,c,sizeof(x[0])*(n+1))
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
#define M 100+5
int main(){
    int n=0,i;
	char s[M];
	memset(s,0,sizeof(s));
    while(gets(s)){
		if(s[0]=='+'||s[0]=='-')continue;
		else{
			i=0;
			while(s[i]!=':')i++;
			i++;
			while(s[i]!='\0')i++,n++;
			n++;
		}
		memset(s,0,sizeof(s));
	}
	printf("%d\n",n);
    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
    string read ;
    int index ;
    int answer = 0 ;
    int counter = 0 ;
    while (getline(cin,read)){
        if (read=="")break ;
        if (*read.begin() == '+'){
            counter++ ;
        }else if (*read.begin() == '-'){
            counter-- ;
        }else {
            index = read.find(':');
            answer += (read.length()-index);
        }
    }
    cout << answer << endl ;
    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
    string read ;
    int index ;
    int answer = 0 ;
    int counter = 0 ;
    while (getline(cin,read)){
        if (read=="")break ;
        if (*read.begin() == '+'){
            counter++ ;
        }else if (*read.begin() == '-'){
            counter-- ;
        }else {
            index = read.find(':');
            answer += (read.length()-index-1)*counter;
        }
    }
    cout << answer << endl ;
    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
    string read ;
    int index ;
    int answer = 0 ;
    int counter = 0 ;
    while (true){
        cin >> read ;
        if (read.length() < 1) break ;
        if (*read.begin() == '+'){
            counter++ ;
        }else if (*read.begin() == '-'){
            counter-- ;
        }else {
            index = read.find(':');
            answer += (read.length()-index);
        }
    }
    cout << answer << endl;
    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
    string read ;
    int index ;
    int answer = 0 ;
    int counter = 0 ;
    while (getline(cin,read)){
        if (read=="")break ;
        if (*read.begin() == '+'){
            counter++ ;
        }else if (*read.begin() == '-'){
            counter-- ;
        }else {
            index = read.find(':');
            answer += (read.length()-index);
        }
        cout << answer << endl;
    }

    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
    string read ;
    int index ;
    int answer = 0 ;
    int counter = 0 ;
    while (true){
        cin >> read ;
        if (*read.begin() == '+'){
            counter++ ;
        }else if (*read.begin() == '-'){
            counter-- ;
        }else {
            index = read.find(':');
            answer += (read.length()-index);
        }
        cout << answer << endl;
    }

    return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main(){
	char s[105];
	int l=0;
	int lbuf=0;
	int m=0;
	for(;fgets(s,100,stdin)!=NULL;){
		if(s[0]!='+'&&s[0]!='-'){
			int nln=0;
			for(int j=0;s[j]!=NULL;j++){
				if(s[j]==':'){
					nln=j+1;//':'+1;
					break;
				}
			}
			if(s[nln]!='\n')nln++;
			lbuf+=strlen(s+nln);
			//'\n'+1;if':'+1is empty,nln+1 is over.
		}
		else{
			l+=lbuf*m;
			lbuf=0;
			if(s[0]=='+')m++;
			else m--;
		}
	}
	l+=lbuf*m;
	printf("%d\n",l);
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main(){
	char s[105];
	int l=0;
	int lbuf=0;
	int m=0;
	for(;fgets(s,103,stdin)!=NULL;){
		if(s[0]!='+'&&s[0]!='-'){
			int nln=0;
			for(int j=0;s[j]!=NULL;j++){
				if(s[j]==':'){
					nln=j+1;
					break;
				}
			}
			lbuf+=strlen(s+nln+1);
		}
		else{
			l+=lbuf*m;
			lbuf=0;
			if(s[0]=='+')m++;
			else m--;
		}
	}
	l+=lbuf*m;
	printf("%d\n",l);
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main(){
	char s[105];
	int l=0;
	int lbuf=0;
	int m=0;
	for(;fgets(s,100,stdin)!=NULL;){
		if(s[0]!='+'&&s[0]!='-'){
			int nln=0;
			for(int j=0;s[j]!=NULL;j++){
				if(s[j]==':'){
					nln=j+1;//':'+1;
					break;
				}
			}
			lbuf+=strlen(s+nln+1);//'\n'+1;
		}
		else{
			l+=lbuf*m;
			lbuf=0;
			if(s[0]=='+')m++;
			else m--;
		}
	}
	l+=lbuf*m;
	printf("%d\n",l);
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main(){
	char s[105];
	int l=0;
	int lbuf=0;
	int m=0;
	for(;fgets(s,101,stdin)!=NULL;){
		if(s[0]!='+'&&s[0]!='-'){
			int nln=0;
			for(int j=0;s[j]!=NULL;j++){
				if(s[j]==':'){
					nln=j+1;
					break;
				}
			}
			lbuf+=strlen(s+nln+1);
		}
		else{
			l+=lbuf*m;
			lbuf=0;
			if(s[0]=='+')m++;
			else m--;
		}
	}
	l+=lbuf*m;
	printf("%d\n",l);
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main(){
	char s[107];
	int l=0;
	int lbuf=0;
	int m=0;
	for(;fgets(s,105,stdin)!=NULL;){
		if(s[0]!='+'&&s[0]!='-'){
			int nln=0;
			for(int j=0;s[j]!=NULL;j++){
				if(s[j]==':'){
					nln=j+1;
					break;
				}
			}
			lbuf+=strlen(s+nln+1);
		}
		else{
			l+=lbuf*m;
			lbuf=0;
			if(s[0]=='+')m++;
			else m--;
		}
	}
	l+=lbuf*m;
	printf("%d\n",l);
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main(){
	char s[105];
	int l=0;
	int lbuf=0;
	int m=0;
	for(;fgets(s,100,stdin)!=NULL;){
		if(s[0]!='+'&&s[0]!='-'){
			int nln=0;
			for(int j=0;s[j]!=NULL;j++){
				if(s[j]==':'){
					if(lbuf)lbuf--;
					nln=j+1;
					break;
				}
			}
			lbuf+=strlen(s+nln);
		}
		else{
			if(lbuf)lbuf--;
			l+=lbuf*m;
			lbuf=0;
			if(s[0]=='+')m++;
			else m--;
		}
	}
	l+=lbuf*m;
	printf("%d\n",l);
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main(){
	char s[105];
	int l=0;
	int lbuf=0;
	int m=0;
	for(;fgets(s,100,stdin)!=NULL;){
		if(s[0]!='+'&&s[0]!='-'){
			int nln=0;
			for(int j=0;s[j]!=NULL;j++){
				if(s[j]==':'){
					nln=j+1;//':'+1;
					break;
				}
			}
			if(s[nln]=='\n')nln++;
			lbuf+=strlen(s+nln);
			//'\n'+1;if':'+1is empty,nln+1 is over.
		}
		else{
			l+=lbuf*m;
			lbuf=0;
			if(s[0]=='+')m++;
			else m--;
		}
	}
	l+=lbuf*m;
	printf("%d\n",l);
	return 0;
}


#include <iostream>
#include<string>
#include<cstring>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main(int argc, const char * argv[])
{
    string s;
    int count=0;
    int number_of_p_in_chat=0;
    while (std::getline(cin,s))
   {
       if(s[0]=='+')
            number_of_p_in_chat++;
        else
            if(s[0]=='-')
            {
                number_of_p_in_chat--;
            }
            else{
            int n=s.find(':');
            count+=(s.size()-n-1)*number_of_p_in_chat;
        }

   }
    cout<<count;
    return 0;
}


#include <iostream>
#include<string>
#include<cstring>
using namespace std;
int main(int argc, const char * argv[])
{
    string s;
    int count;
    int number_of_p_in_chat=0;
  // while (std::getline(cin,s))
       for(int i=0;i<100;i++)
   {
       getline(cin,s);
       if(s[0]!=EOF && s[0]!=' '){
       if(s[0]=='+')
            number_of_p_in_chat++;
        else
            if(s[0]=='-')
            {
                number_of_p_in_chat--;
            }
            else{
            int n=s.find(':');
            count+=(s.size()-n-1)*number_of_p_in_chat;
        }
    }
       else
       {
           cout<<count;
       }
   }

    return 0;
}


#include <iostream>
#include<string>
#include<cstring>
using namespace std;
int main(int argc, const char * argv[])
{
    string s;
    int count;
    while (std::getline(cin,s))
    //for(int i=0;i<4;i++)
    {
        getline(cin,s);
        if(s[0]=='+'||s[0]=='-')continue;
        else{
            int n=s.find(':');
            count+=s.size()-n-1;
        }
    }
    cout<<count;
    return 0;
}


//
//  main.cpp
//  Beta_5_A
//
//  Created by Igor Mel. on 3/24/13.
//  Copyright (c) 2013 Igor Mel. All rights reserved.
//

#include <iostream>
#include<string>
#include<cstring>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main(int argc, const char * argv[])
{
    string s;
    int count;
    int number_of_p_in_chat=0;
  // while (std::getline(cin,s))
       for(int i=0;i<100;i++)
   {
       getline(cin,s);
       if(s[0]!=EOF && s[0]!=' '){
       if(s[0]=='+')
            number_of_p_in_chat++;
        else
            if(s[0]=='-')
            {
                number_of_p_in_chat--;
            }
            else{
            int n=s.find(':');
            count+=(s.size()-n-1)*number_of_p_in_chat;
        }
    }
       else
       {
           cout<<count;
       }
   }

    return 0;
}


#include <iostream>
#include<string>
#include<cstring>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main(int argc, const char * argv[])
{
    string s;
    int count;
    int number_of_p_in_chat=0;
    while (std::getline(cin,s))
   {
       if(s[0]=='+')
            number_of_p_in_chat++;
        else
            if(s[0]=='-')
            {
                number_of_p_in_chat--;
            }
            else{
            int n=s.find(':');
            count+=(s.size()-n-1)*number_of_p_in_chat;
        }

   }
    cout<<count;
    return 0;
}


#include <iostream>
#include<string>
#include<cstring>
using namespace std;
int main(int argc, const char * argv[])
{
    string s;
    int count;
    int number_of_p_in_chat=0;
    while (std::getline(cin,s))
    //for(int i=0;i<4;i++)
    {
        getline(cin,s);
        if(s[0]=='+')
            number_of_p_in_chat++;
        else
            if(s[0]=='-')
            {
                number_of_p_in_chat--;
            }
            else{
            int n=s.find(':');
            count+=(s.size()-n-1)*number_of_p_in_chat;
        }
    }
    cout<<count;
    return 0;
}


//
//  main.cpp
//  Beta_5_A
//
//  Created by Igor Mel. on 3/24/13.
//  Copyright (c) 2013 Igor Mel. All rights reserved.
//

#include <iostream>
#include<string>
#include<cstring>
using namespace std;
int main(int argc, const char * argv[])
{
    string s;
    int count;
    int number_of_p_in_chat=0;
    while (std::getline(cin,s))
    //for(int i=0;i<4;i++)
    {
     //   getline(cin,s);
        if(s[0]=='+')
            number_of_p_in_chat++;
        else
            if(s[0]=='-')
            {
                number_of_p_in_chat--;
            }
            else{
            int n=s.find(':');
            count+=(s.size()-n-1)*number_of_p_in_chat;
        }
    }
    cout<<count;
    return 0;
}


#include <iostream>
#include<string>
#include<cstring>
using namespace std;
int main(int argc, const char * argv[])
{
    string s;
    int count;
    int number_of_p_in_chat=0;
   while (std::getline(cin,s))
   {        if(s[0]=='+')
            number_of_p_in_chat++;
        else
            if(s[0]=='-')
            {
                number_of_p_in_chat--;
            }
            else{
            int n=s.find(':');
            count+=(s.size()-n-1)*number_of_p_in_chat;
        }
    }
    cout<<count;
    return 0;
}


#include <iostream>
#include <string>
using namespace std;
string a[105];
int s,res;
int main(){
	string x;
	for (int i=0;i<100;i++){
		getline(cin,x);
		int len=x.size();
		if (x[0]=='+'){
			s++;
		}
		else if (x[0]=='-'){
			s--;
		}
		else{
			int i=0;
			for (i=0;i<len;i++){
				if (x[i]==':'){
					break;
				}
			}
			res+=(len-1-i)*s;
		}
		if (i==6){
			cout<<res<<"\n";
			return 0;
		}

	}

	return 0;
}


#include <iostream>
#include <string>
using namespace std;
string a[105];
int s,res;
int main(){
	string x;
	while (getline(cin,x)){
		int len=x.size();
		if (x[0]=='+'){
			s++;
		}
		else if (x[0]=='-'){
			s--;
		}
		else{
			int i=0;
			for (i=0;i<len;i++){
				if (x[i]==':'){
					break;
				}
			}
			//cout<<len<<" "<<i<<"\n";
			res+=(len-1-i)*s;
		}

	}
	cout<<res;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;
string a[105];
int s,res;
int main(){
	string x;
	while (getline(cin,x)){
		if (x==""){
			cout<<res<<"\n";
			return 0;
		}
		int len=x.size();
		if (x[0]=='+'){
			s++;
		}
		else if (x[0]=='-'){
			s--;
		}
		else{
			int i=0;
			for (i=0;i<len;i++){
				if (x[i]==':'){
					break;
				}
			}
			//cout<<len<<" "<<i<<"\n";
			res+=(len-1-i)*s;
		}

	}

	return 0;
}


#include <iostream>
#include <string>
using namespace std;
string a[105];
int s,res;
int main(){
	string x;
	while (getline(cin,x)){
		//if (x==""){
			//cout<<res;
			//return 0;
		//}
		int len=x.size();
		if (x[0]=='+'){
			s++;
		}
		else if (x[0]=='-'){
			s--;
		}
		else{
			//cout<<len<<" "<<i<<"\n";
			res+=s*x.substr(x.find(':')+1).size();
		}

	}
	cout<<res;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;
string a[105];
int s,res;
int main(){
	string x;
	for (int i=0;i<100;i++){
		getline(cin,x);
		if (x==""){
			cout<<res<<"\n";
			return 0;
		}
		int len=x.size();
		if (x[0]=='+'){
			s++;
		}
		else if (x[0]=='-'){
			s--;
		}
		else{
			int i=0;
			for (i=0;i<len;i++){
				if (x[i]==':'){
					break;
				}
			}
			//cout<<len<<" "<<i<<"\n";
			res+=(len-1-i)*s;
		}

	}

	return 0;
}


#include <iostream>
#include <string>
using namespace std;
string a[105];
int s,res;
int main(){
	string x;
	while (getline(cin,x)){
		if (x==""){
			cout<<res;
			return 0;
		}
		int len=x.size();
		if (x[0]=='+'){
			s++;
		}
		else if (x[0]=='-'){
			s--;
		}
		else{
			//cout<<len<<" "<<i<<"\n";
			res+=s*x.substr(x.find(':')+1).size();
		}

	}
	//cout<<res;
	return 0;
}


#include <cstdio>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <queue>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;

string a[1000];

vector<string> Q;
int main()
{
    int tol=0,sum=0;
    while(getline(cin,a[tol++])) if(tol==7) break;

    for(int i=0;i<tol;i++)
    {
        string tmp="";
        if(a[i][0]=='+')
        {
            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
           // cout<<tmp<<endl;
            Q.push_back(tmp);
        }
        else if(a[i][0]=='-')
        {

            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
           // cout<<tmp<<endl;
            int l=Q.size();
            for(int j=0;j<l;j++)
                if(Q[j]==tmp)
                    {
                       Q.erase(Q.begin()+j);
                        break;
                    }
        }
        else
        {
            int ans=a[i].size();
            int tol=0;
            while(a[i][tol]!=':')
            {
                tol++;
            }
            tol++;
            sum+=(ans-tol)*Q.size();
        }
    }
    printf("%d\n",sum);
}


#include <stdio.h>
#include<math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <stdlib.h>
#include <vector>
#include <set>
#include <map>
#define ll __int64
using namespace std;
char s[110];
int main()
{
    int i,j,l,c=0,ans=0;
	while(gets(s))
	{
		if(s[0] == '+' ) c++;
		else if(s[0] == '-' ) c--;
		else
		{
			int tmp=0;
			l=strlen(s);
			for(i=0;i<l;i++)
				if(s[i] == ':')
					break;
			tmp=l-i-1;
			ans+=tmp*c;
		}
	}
	printf("%d\n",ans);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
using namespace std;
set<string>st;
int main()
{
    ios::sync_with_stdio(false);
    string str;
    int res=0;
    while(getline(cin,str))
    {
        int ty;
        if(str[0]=='+')ty=0;
        else if(str[0]=='-')ty=1;
        else ty=2;
        if(ty<2)
        {
            str=str.substr(1);
            if(ty==0)st.insert(str);
            else st.erase(str);
        }
        else
        {
            int loc=0;
            while(str[loc]!=':')loc++;
            str=str.substr(loc+1);
            res+=(int)str.length()*st.size();
        }
    }
    printf("%d\n",res);
    return 0;
}


#include<iostream>
#include<string>
#include<stdlib.h>
#include<cstdio>
using namespace std;
int main()
{
 	char a[100];
	char b;
	int count = 0;
	int cc = 0;
	while (1){
		gets(a);
		if(strlen(a) == 0)
			break;
		if(a[0] == '+')
			count++;
		else if(a[0] == '-')
			count--;
		else {
			int ccc = 0;
			for (int i = strlen(a)-1; i >= 0; i--){
				if(a[i] == ':')
					break;
				ccc++;
			}
			cc = cc + ccc*count;
		}
		//getchar(b);
	}
	cout<<cc<<endl;

	return 0;

}


#include <cstdio>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <queue>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;

string a[1000];

vector<string> Q;
int main()
{
    int tol=0,sum=0;
    while(getline(cin,a[tol++]))

    for(int i=0;i<tol;i++)
    {
        string tmp="";
        if(a[i][0]=='+')
        {
            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
            Q.push_back(tmp);
        }
        else if(a[i][0]=='-')
        {

            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
            int l=Q.size();
            for(int j=0;j<l;j++)
                if(Q[j]==tmp)
                    {
                       Q.erase(Q.begin()+j);
                        break;
                    }
        }
        else
        {
            int ans=a[i].size();
            int tol=0;
            while(a[i][tol]!=':')
            {
                tol++;
            }
            tol++;
            sum+=(ans-tol)*Q.size();
        }
    }
    printf("%d\n",sum);
}


#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<cstdio>
using namespace std;
int main()
{
 	char a[100];
	char b;
	int count = 0;
	int cc = 0;
	while (1){
		gets(a);
		if(strlen(a) == 0)
			break;
		if(a[0] == '+')
			count++;
		else if(a[0] == '-')
			count--;
		else {
			int ccc = 0;
			for (int i = strlen(a)-1; i >= 0; i--){
				if(a[i] == ':')
					break;
				ccc++;
			}
			cc = cc + ccc*count;
		}
		//getchar(b);
	}
	cout<<cc<<endl;

	return 0;

}


#include <cstdio>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <queue>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;

string a[1000];

vector<string> Q;
int main()
{
//    freopen("in.txt","r",stdin);
    int tol=0,sum=0;
    while(getline(cin,a[tol])) tol++ ;

    for(int i=0;i<tol;i++)
    {
        string tmp="";
        if(a[i][0]=='+')
        {
            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
            Q.push_back(tmp);
        }
        else if(a[i][0]=='-')
        {

            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
            int l=Q.size();
            for(int j=0;j<l;j++)
                if(Q[j]==tmp)
                    {
                       Q.erase(Q.begin()+j);
                        break;
                    }
        }
        else
        {
            int ans=a[i].size();
            int tol=0;
            while(a[i][tol]!=':')
            {
                tol++;
            }
            tol++;
            sum+=(ans-tol)*Q.size();
        }
    }
    printf("%d\n",sum);
}


#include <cstdio>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <queue>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;

string a[1000];

vector<string> Q;
int main()
{
    int tol=0,sum=0;
    while(getline(cin,a[tol++])) ;

    for(int i=0;i<tol;i++)
    {
        string tmp="";
        if(a[i][0]=='+')
        {
            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
            Q.push_back(tmp);
        }
        else if(a[i][0]=='-')
        {

            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
            int l=Q.size();
            for(int j=0;j<l;j++)
                if(Q[j]==tmp)
                    {
                       Q.erase(Q.begin()+j);
                        break;
                    }
        }
        else
        {
            int ans=a[i].size();
            int tol=0;
            while(a[i][tol]!=':')
            {
                tol++;
            }
            tol++;
            sum+=(ans-tol)*Q.size();
        }
    }
    printf("%d\n",sum);
}


#include <cstdio>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <queue>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;

string a[1000];

vector<string> Q;
int main()
{
    freopen("in.txt","r",stdin);
    int tol=0,sum=0;
    while(getline(cin,a[tol])) tol++ ;

    for(int i=0;i<tol;i++)
    {
        string tmp="";
        if(a[i][0]=='+')
        {
            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
            Q.push_back(tmp);
        }
        else if(a[i][0]=='-')
        {

            for(int j=1;j<a[i].size();j++)
                tmp+=a[i][j];
            int l=Q.size();
            for(int j=0;j<l;j++)
                if(Q[j]==tmp)
                    {
                       Q.erase(Q.begin()+j);
                        break;
                    }
        }
        else
        {
            int ans=a[i].size();
            int tol=0;
            while(a[i][tol]!=':')
            {
                tol++;
            }
            tol++;
            sum+=(ans-tol)*Q.size();
        }
    }
    printf("%d\n",sum);
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
    char a[100];
    int sum=0;
    int ans=0;
    while(gets(a))
    {
        int len=strlen(a);
        if(a[0]=='+')
            sum++;
        else if(a[0]=='-')
            sum--;
        else
        {
            int p=0;
            for(int i=0;i<len;i++)
                if(a[i]==':')
                    p=i;
            ans+=(len-p-1)*sum;
        }
    }
    cout<<ans<<endl;
    return 0;
}


#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<cstdio>
using namespace std;
int main()
{
 	char a[100];
	char b;
	int count = 0;
	int cc = 0;
//	int dd = 0;
	while (gets(a)){
		if(a[0] == '+')
			count++;
		else if(a[0] == '-')
			count--;
		else {
			int ccc = 0;
			for (int i = strlen(a)-1; i >= 0; i--){
				if(a[i] == ':')
					break;
				ccc++;
			}
			cc = cc + ccc*count;
		}
	//	getchar(b);
	}
	cout<<cc<<endl;

	return 0;

}


#include <stdio.h>
#include <string.h>

int main()
{
    char str[101];
    int num = 0, ans = 0, len;

    while(gets(str))
    {
        if(str[0] == '+')
            num++;
        else if(str[0] == '-')
            num--;
        else
        {
            len = strlen(str) - 1;
            for(int i = 0; str[i] != ':'; i++)
                len--;
            ans += num * len;
        }
    }
    printf("%d", ans);

    return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
int k,sum;
while(getline(cin,s)){
  if(s[0]=='+') {k++;
  continue;}
  else if(s[0]=='-'){ k--;
  continue;}
  sum=sum+k*(s.size()-s.find(':')-1);
}
cout<<sum;
}


#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
int sum,k;
while(getline(cin,s))
 if(s[0] == '+')k++;
 else if(s[0] == '-')k--;
 else sum=sum+k*(s.size() - s.find(':') -1 );
 cout<<sum;
}


#include<iostream>
#include<string>
using namespace std;
int main(){
while(string s;
int sum,k;
getline(cin,s))
 if(s[0] == '+')k++;
 else if(s[0] == '-')k--;
 else sum=sum+k*(s.size() - s.find(':') -1 );
 cout<<sum;
}


#include<iostream>
#include<string>
using namespace std;
string s;
int sum,k;
int main(){
while(getline(cin,s))
 if(s[0] == '+')k++;
 else if(s[0] == '-')k--;
 else sum=sum+k*(s.size() - s.find(':') -1 );
 cout<<sum;
}


#include<iostream>
#include<string>
using namespace std;
string s;
int sum,k;
int main(){
while(getline(cin,s)){
 getline(cin,s);
 if(s[0]=='+')k++;
 else if(s[0]=='-')k--;
 sum=sum+k*(s.size()-s.find(':'));
 cout<<sum;
}

}


#include<iostream>
#include<string>
using namespace std;
string s;
int sum,k;
int main(){
while(getline(cin,s))
 getline(cin,s);
 if(s[0] == '+')k++;
 else if(s[0] == '-')k--;
 else sum=sum+k*(s.size() - s.find(':') -1 );
 cout<<sum;
}


#include <iostream>
#include <map>

using namespace std;

int main(int argc, char *argv[]) {
  int length = 0;
  string command;
  map<string, int> users;

  while (getline(cin, command)) {
    if (command[0] == '+') {
      users[command.substr(1)] = 1;
    } else if (command[0] == '-') {
      users.erase(command.substr(1));
    } else {
      length += (command.size() - command.find(':')) * users.size();
    }
  }

  return 0;
}


#include <iostream>
#include <map>

using namespace std;

int main(int argc, char *argv[]) {
  int length = 0;
  string command;
  map<string, int> users;

  while (getline(cin, command, '\n')) {
    if (command[0] == '+') {
      users[command.substr(1)] = 1;
    } else if (command[0] == '-') {
      users.erase(command.substr(1));
    } else {
      length += (command.size() - command.find(':')) * users.size();
    }
  }

  return 0;
}


#include <iostream>
#include <set>

using namespace std;

int main(int argc, char *argv[]) {
  int length = 0;
  string command;
  set<string> users;

  while (getline(cin, command)) {
    if (command[0] == '+') {
      users.insert(command.substr(1));
    } else if (command[0] == '-') {
      users.erase(command.substr(1));
    } else {
      length += (command.size() - command.find(':') - 1) * users.size();
    }
  }

  cout << length << endl;

  return 0;
}


#include <iostream>
#include <set>

using namespace std;

int main(int argc, char *argv[]) {
  int length = 0;
  string command;
  set<string> users;

  while (getline(cin, command)) {
    cout << command << endl;
    if (command[0] == '+') {
      users.insert(command.substr(1));
    } else if (command[0] == '-') {
      users.erase(command.substr(1));
    } else {
      length += (command.size() - command.find(':') - 1) * users.size();
    }
  }

  return 0;
}


#include <iostream>
#include <set>

using namespace std;

int main(int argc, char *argv[]) {
  int length = 0;
  string command;
  set<string> users;

  while (getline(cin, command)) {
    if (command[0] == '+') {
      users.insert(command.substr(1));
    } else if (command[0] == '-') {
      users.erase(command.substr(1));
    } else {
      length += (command.size() - command.find(':') - 1) * users.size();
    }
  }

  return 0;
}


#include <iostream>
#include<string>
#include<locale>
#include <cstdio>
#include <cctype>
#include <algorithm>
using namespace std;

int main()
{
    int m=0,sol=0;

    string u;

 while (getline(cin,u))
    {

       if(u[0]=='+')
           {m++;}
       else if(u[0]=='-')
            m--;
             else
           {
           sol+=((u.length()-u.find(":")-1)*m);
    }

   }
    cout<<sol;
    }