#include <bits/stdc++.h>
using namespace std;
bool isPalindrome(string &str, int begin, int end) {
  int mid = (end - begin + 1) / 2;
  for (int i = 0; i < mid; ++i) {
    if (str.at(begin + i) != str.at(end - i)) return false;
  }
  return true;
}
int main() {
  string str;
  cin >> str;
  vector<int> A(str.size(), 0), B(str.size(), 0);
  for (int i = 0; i < str.size(); ++i) {
    for (int j = i; j < str.size(); ++j) {
      if (isPalindrome(str, i, j)) {
        A[j]++;
        B[i]++;
      }
    }
  }
  for (int i = str.size() - 2; i >= 0; --i) {
    B[i] = B[i] + B[i + 1];
  }
  unsigned long long sum = 0;
  for (int i = 0; i < str.size() - 1; ++i) {
    sum += A[i] * B[i + 1];
  }
  cout << sum;
  return 0;
}
