You will receive 3 points for solving this problem.

Manao is designing the genetic code for a new type of algae to efficiently produce fuel. Specifically, Manao is focusing on a stretch of DNA that encodes one protein. The stretch of DNA is represented by a string containing only the characters 'A', 'T', 'G' and 'C'.

Manao has determined that if the stretch of DNA contains a maximal sequence of consecutive identical nucleotides that is of even length, then the protein will be nonfunctional. For example, consider a protein described by DNA string "GTTAAAG". It contains four maximal sequences of consecutive identical nucleotides: "G", "TT", "AAA", and "G". The protein is nonfunctional because sequence "TT" has even length.

Manao is trying to obtain a functional protein from the protein he currently has. Manao can insert additional nucleotides into the DNA stretch. Each additional nucleotide is a character from the set {'A', 'T', 'G', 'C'}. Manao wants to determine the minimum number of insertions necessary to make the DNA encode a functional protein.
The input consists of a single line, containing a string *s* of length *n* (1 ≤ *n* ≤ 100). Each character of *s* will be from the set {'A', 'T', 'G', 'C'}.

This problem doesn't have subproblems. You will get 3 points for the correct submission.
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-06-02T07:20:20.604238Z",
     "start_time": "2020-06-02T07:20:18.361424Z"
    }
   },
   "outputs": [],
   "source": [
    "a = 0\n",
    "t = 0\n",
    "g = 0\n",
    "c = 0\n",
    "rep = 0\n",
    "genom = input()\n",
    "genom = list(genom)\n",
    "for i in range (0,len(genom)):\n",
    "    if genom[i] == 'A':\n",
    "        a+=1\n",
    "    elif genom[i] == 'T':\n",
    "        t+=1\n",
    "    elif genom[i] == 'G':\n",
    "        g+=1\n",
    "    elif genom[i] == 'C':\n",
    "        c+=1\n",
    "for i in range (0,len(genom)):\n",
    "    if a % 2 != 0:\n",
    "        rep+=1\n",
    "    elif t % 2 != 0:\n",
    "        rep+=1\n",
    "    elif g % 2 != 0:\n",
    "        rep+=1\n",
    "    elif c % 2 != 0:\n",
    "        rep+=1\n",
    "print(rep)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-06-02T07:25:15.567739Z",
     "start_time": "2020-06-02T07:25:11.269641Z"
    }
   },
   "outputs": [],
   "source": [
    "a = 0\n",
    "t = 0\n",
    "g = 0\n",
    "c = 0\n",
    "rep = 0\n",
    "genom = input()\n",
    "genom = list(genom)\n",
    "for i in range (0,len(genom)):\n",
    "    if genom[i] == 'A':\n",
    "        a+=1\n",
    "    elif genom[i] == 'T':\n",
    "        t+=1\n",
    "    elif genom[i] == 'G':\n",
    "        g+=1\n",
    "    elif genom[i] == 'C':\n",
    "        c+=1\n",
    "if a % 2 != 0:\n",
    "    rep+=1\n",
    "elif t % 2 != 0:\n",
    "    rep+=1\n",
    "elif g % 2 != 0:\n",
    "    rep+=1\n",
    "elif c % 2 != 0:\n",
    "    rep+=1\n",
    "print(rep)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "letters = []\n",
    "genom = input()\n",
    "genom = list(genom)\n",
    "for i in range (0,len(genom)):\n",
    "    letters.append(genom[i])\n",
    "    if genom[i+1] == letters:\n",
    "        a+=1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "GTGAATTTCC\n"
     ]
    },
    {
     "ename": "IndexError",
     "evalue": "list index out of range",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-3-2a9a05f64816>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m     16\u001b[0m         \u001b[0mnum\u001b[0m\u001b[1;33m+=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     17\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0manswer\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 18\u001b[1;33m \u001b[0msolution\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstring\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32m<ipython-input-3-2a9a05f64816>\u001b[0m in \u001b[0;36msolution\u001b[1;34m(string)\u001b[0m\n\u001b[0;32m      8\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mnum\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m'\\n'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      9\u001b[0m             \u001b[1;32mreturn\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0manswer\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 10\u001b[1;33m         \u001b[1;32melif\u001b[0m \u001b[0mi\u001b[0m \u001b[1;33m==\u001b[0m \u001b[0mstring\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mnum\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     11\u001b[0m             \u001b[0mcount\u001b[0m\u001b[1;33m+=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     12\u001b[0m         \u001b[1;32melif\u001b[0m \u001b[0mi\u001b[0m \u001b[1;33m!=\u001b[0m \u001b[0mstring\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mnum\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mIndexError\u001b[0m: list index out of range"
     ]
    }
   ],
   "source": [
    "string = input()\n",
    "string = list(string)\n",
    "def solution(string):\n",
    "    count = 1\n",
    "    answer = 0\n",
    "    num = 0\n",
    "    for i in string:\n",
    "        if num == len(string)-1:\n",
    "            return print(answer)\n",
    "        elif i == string[num+1]:\n",
    "            count+=1\n",
    "        elif i != string[num+1]:    \n",
    "            if count % 2 == 0 and count!= 0:\n",
    "                answer += 1\n",
    "            count = 1\n",
    "        num+=1\n",
    "    return print(answer)\n",
    "solution(string)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "AAACCTTAA\n",
      "2\n"
     ]
    }
   ],
   "source": [
    "string = input()\n",
    "string = list(string)\n",
    "def solution(string):\n",
    "    count = 1\n",
    "    answer = 0\n",
    "    num = 0\n",
    "    for i in string:\n",
    "        if num == len(string)-1:\n",
    "            return print(answer)\n",
    "        elif i == string[num+1]:\n",
    "            count+=1\n",
    "        elif i != string[num+1]:    \n",
    "            if count % 2 == 0 and count!= 0:\n",
    "                answer += 1\n",
    "            count = 1\n",
    "        num+=1\n",
    "    return print(answer)\n",
    "solution(string)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
