#include <bits/stdc++.h>
using namespace std;
int main() {
  string second;
  cin >> second;
  vector<int> st, en;
  int p = 0, q = 0;
  for (int cnt = 0;; cnt++) {
    int i = p;
    int j = q;
    if (cnt % 2 == 0)
      q++;
    else
      p++;
    while (i >= 0 && j < second.size()) {
      if (second[i] != second[j]) break;
      st.push_back(i);
      en.push_back(j);
      i--;
      j++;
    }
    if (q == second.size()) break;
  }
  sort(st.begin(), st.end());
  sort(en.begin(), en.end());
  long long ans = 0;
  for (int i = 0; i < en.size(); i++) {
    long long it = upper_bound(st.begin(), st.end(), en[i]) - st.begin();
    ans += (long long)st.size() - it;
  }
  cout << ans << endl;
}
