#include <bits/stdc++.h>
using namespace std;
const int N = 2000;
string s;
int dp[N], exista_pali[N][N], n;
void cauta_pali(int st, int dr) {
  while (st >= 0 && dr < n && s[st] == s[dr]) {
    exista_pali[st][dr] = 1;
    dp[dr]++;
    st--;
    dr++;
  }
}
int main() {
  cin >> s;
  n = s.length();
  for (int i = 0; i < n; i++) {
    cauta_pali(i, i);
    if (i < n) {
      cauta_pali(i, i + 1);
    }
  }
  for (int i = 1; i < n; i++) {
    dp[i] += dp[i - 1];
  }
  long long rez = 0;
  for (int i = 1; i < n; i++) {
    for (int j = i; j < n; j++) {
      rez += dp[i - 1] * exista_pali[i][j];
    }
  }
  cout << rez;
  return 0;
}
