#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[20001];
  int b[20001];
  for (int i = 0; i < 20001; i++) {
    a[i] = 0;
    b[i] = 0;
  }
  string str;
  cin >> str;
  int gj = str.length();
  for (int i = 1; i < gj; i++) {
    for (int j = 0; j + i < gj; j++) {
      a[j + i]++;
      for (int ii = j, ff = 0; ii < j + i / 2; ii++, ff++)
        if (str[ii] != str[j + i - 1 - ff]) {
          a[j + i]--;
          break;
        }
    }
  }
  string hh = "";
  for (int ii = 0; ii < gj; ii++) hh = str[ii] + hh;
  str = hh;
  for (int i = 1; i < gj; i++) {
    for (int j = 0; j + i < gj; j++) {
      b[j + i]++;
      for (int ii = j, ff = 0; ii < j + i / 2; ii++, ff++)
        if (str[ii] != str[j + i - 1 - ff]) {
          b[j + i]--;
          break;
        }
    }
  }
  long long numb = 0;
  for (int j = 1; j < gj; j++) b[j] = b[j] + b[j - 1];
  for (int i = 1; i < gj; i++) numb = numb + a[i] * b[gj - i];
  cout << numb;
}
